3 ms·
That has nothing to do with PHP and everything to do with that the webserver runs as a different user than the creator of the files. Unless you have root it's
by ars 10y ago
That has nothing to do with PHP and everything to do with that the webserver runs as a different user than the creator of the files.
Unless you have root it's rather difficult to make a directory that the webserver can write to.
It's not specific to PHP, except that PHP is used for web scripting.
The correct way to do it, if you don't have root is:
Make a directory 777 (yes, you do need to). Have the webserver create a subdirectory owned by the webserver. Change the parent directory away from 777 to 755 or 775.
Double check that no one else created something in there while it was wide open.
Be aware that ALL users on that machine who can run web scripts have access to that directory.
An even better way is with mpm-itk