setting directory permission for file upload

This is a discussion on setting directory permission for file upload within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Using the php manual code examples, I have built a webpage to select a local file and upload it to ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-17-2006
news
 
Posts: n/a
Default setting directory permission for file upload

Using the php manual code examples, I have built a webpage to select a
local file and upload it to the server. At home I have a WAMP setup
(win2k) and it works fine. My live server is running linux. I have
re-set the directory permission from 755 to 777 to get it to work. Can
someone explain to me, or point me to a website that can explain why
group and world need write access? Or does just world need this? I was
under the false impression that the php was running as owner, but I
guess it isn't

Thanks,

Joel Goldstick
Reply With Quote
  #2 (permalink)  
Old 01-23-2006
Gnutt Halvordsson
 
Posts: n/a
Default Re: setting directory permission for file upload

World and group does not actually need write-access.
PHP need read-write-access to the files, and/or read-write-execute on
the directory which uploads are ment to be.

If you find out as which group the PHP-script executes it's scripts
you can change ownership of the directory which php works within.

PHP genrally runs as the user who executes it (this is often apache).
Therefore it's apache who will need write-permissions.

So give apache (on some systems www-data)-group writeaccess on the
directory intended.

chown <user>:www-data php-work-folder
chmod 775 php-work-folder

news skrev:
> Using the php manual code examples, I have built a webpage to select a
> local file and upload it to the server. At home I have a WAMP setup
> (win2k) and it works fine. My live server is running linux. I have
> re-set the directory permission from 755 to 777 to get it to work. Can
> someone explain to me, or point me to a website that can explain why
> group and world need write access? Or does just world need this? I was
> under the false impression that the php was running as owner, but I
> guess it isn't
>
> Thanks,
>
> Joel Goldstick

Reply With Quote
Reply


Thread Tools
Display Modes

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

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



All times are GMT +1. The time now is 10:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0