Jump to content


Photo

Cant upload to directory owned by Apache


  • Please log in to reply
2 replies to this topic

#1 Mortier

Mortier
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 16 August 2006 - 05:41 PM

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.

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!

Greetings,

Alex

#2 karthikeyan_coder

karthikeyan_coder
  • Members
  • PipPipPip
  • Advanced Member
  • 201 posts

Posted 16 August 2006 - 05:50 PM

Hey

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:
http://www.php.net/m...loaded-file.php

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.
www.karthi.us

#3 Mortier

Mortier
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 17 August 2006 - 11:07 AM

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/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.
Translation is:
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