Mortier Posted August 16, 2006 Share Posted August 16, 2006 Hello people!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.[b]This is the error:[/b]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[b]There are no $_FILES errors.[/b]Hope you people can help me!Greetings,Alex Quote Link to comment Share on other sites More sharing options...
karthikeyan_coder Posted August 16, 2006 Share Posted August 16, 2006 HeyA 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:http://www.php.net/manual/en/function.move-uploaded-file.phpNote: 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. Quote Link to comment Share on other sites More sharing options...
Mortier Posted August 17, 2006 Author Share Posted August 17, 2006 I don't really see what you exactly mean but I've been trying: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/manual/nl/function.move-uploaded-file.phpThere's the following statement:[i]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]I can not find this sentence in the English manual, weirdly.Translation is:[i]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[/i]This sentence describes the problem perfectly, but does not come with a solution. But I don't get it because you say:[i]move_uploaded_file() is not affected by the [b]normal[/b] safe mode UID-restrictions[/i]This situation is then not a 'normal' one I suppose.Thanks for your help, though I haven't found a solution yet. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.