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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|