Cant upload to directory owned by Apache
Posted 16 August 2006 - 05:41 PM
I'm experiencing some problems with my upload script. I have written my own upload script and it uploads to a directory made in that same script. The problem is that due to the SAFE MODE the upload fails.
When I set the permission of the directory to 777 it still doesn't work. I think it has to do with the GID & UID because the directory is Apache and the script-owner is me (ftp account).
I can not alter any settings because I use a webhost.
This is the error:
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 558 is not allowed to access /home/ivograsman/domains/ivograsman.nl/public_html/ogp/img/artikelen/2 owned by uid 101 in /home/ivograsman/domains/ivograsman.nl/public_html/ogp/test.php on line 14
There are no $_FILES errors.
Hope you people can help me!
Posted 16 August 2006 - 05:50 PM
A note on the COPY function on php.net: ## move_uploaded_file Bypasses safe mode and base_dir securities (the function is totally safe, no danger) ##
Here is the function reference:
Note: move_uploaded_file() is not affected by the normal safe mode UID-restrictions. This is not unsafe because move_uploaded_file() only operates on files uploaded via PHP.
Hope it helps.
Posted 17 August 2006 - 11:07 AM
To use the copy function which gives the same error. I've checked the manual for move_uploaded_file() and in the Dutch manual @ http://nl3.php.net/m...loaded-file.php
There's the following statement:
Opmerking: Als safe-mode aan staat, zal PHP kijken of de bestanden of directories waarmee je wilt werken dezelfde UID heeft als het script dat wordt uitgevoerd.
I can not find this sentence in the English manual, weirdly.
Note: If safe-mode is turned ON, PHP will check if the file or directories you choose to work with have the same UID as the executing script
This sentence describes the problem perfectly, but does not come with a solution.
But I don't get it because you say:
move_uploaded_file() is not affected by the normal safe mode UID-restrictions
This situation is then not a 'normal' one I suppose.
Thanks for your help, though I haven't found a solution yet.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users