Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP uploaded files not assigned to a owner?
Old 01-19-2008, 02:48 PM PHP uploaded files not assigned to a owner?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Hey,

im trying to make a simple user/file system so user can uplaod files to a folder.

but it seems that the files uplaoded are set to Nobody as the owner, so when i try to delete/modify via FTP or cPanel i get permission denied, and i then have to use PHP unlink() to delete them

So how do i assign the owner as imedia (my cpanel username for the account)

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 01-19-2008, 04:10 PM Re: PHP uploaded files not assigned to a owner?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I don't know about cpanel, but this is the procedure when using a raw apache install on a managed server:

Nobody is the Unix shell account under which the apache process is running.
You have several options:
1) modify the apache configuration to force it to run under another account. Not recommended, because it gives more rights on the computer to the service, which ease the task to hacker if they can use a buffer overflow bug

2) change the umask used by "nobody" on the server start, and makes the files created by the apache process "group readable/writable".
The umask utility is for that. I believe "umask 002" is what you would need.
Then create a new unix group, and set your FTP user and the apache user members of that group.

Now, as the umask specify that both of you are in the same group, and the files have group permissions that gives every members of the group full access permissions, you will be able to delete them

And if you are on a shared hosting account, then you must use your "remote file manager" or something like that to either change the ownership or the files permissions.
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 01-19-2008 at 04:12 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to PHP uploaded files not assigned to a owner?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11148 seconds with 12 queries