Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAFE MODE and open_basedir restriction?

Status
Not open for further replies.

dkdude

Programmer
Jun 16, 2003
849
DK
Hi,

I wrote some code that runs fine on my local host. However, when I upload it to my public server I get the following two warnings:

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 998 is not allowed to access / by uid 0 in / on line 20

... and ...

Warning: copy() [function.copy]: open_basedir restriction in effect. File(/tmp/phpMsBQ1r) is not within the allowed path(s): (/ in / on line 32

Can someone give me an idea what the problem is?

Thanks §;O)


Jakob
 
Thanks sleipnir214,

Looks like I cannot use file_exists in safe mode after all!

-Got any idea how to check if a file/dir exists, that works in safe mode?

Regards §;O)


Jakob
 
file_exists() will work. It's just that PHP gets real paranoid about permissions on files. If the owner of the file doesn't match what PHP runs as, it barfs.

You might try, if possible, changing ownership of the files in question.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
sleipnir214,

I contacted the provider (host). They had some kind of odd suggestion, that didn't make sense. Guess what -now it works! They must have changed something without telling me. Nice, however §;O)

You're right : paranoia seems to be the case towards ownership in PHP. I've read pro's and con's regarding safe mode -I think that providers turn it on just for the sake of being on the safe side...

Anyway, thanks for your advide §;O)


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top