PHP safe mode problem

Associate
Joined
18 Oct 2002
Posts
1,581
Location
Nottingham
Having a problem with php safe mode.

In my php code a php file is created but when you try to use this file it throws up safe mode errors when it tries to include files, saying the the uid are not the same. This is cos some files have been created and uploaded by me and this file has been created by the server.

I have tried editing the php.ini but it doesnt seem to make a difference. When creating the file in php can i set its uid?

:confused:
 
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
Turn off safe mode :)

Edit: Depending on the access you have to your server you can allow the uid check to be bypassed with the safe_mode_include_dir setting. So, for example, /tmp would be a good one to add (or whichever location is your temporary directory for uploaded files.)
 
Last edited:
Associate
OP
Joined
18 Oct 2002
Posts
1,581
Location
Nottingham
i have tried turning safe mode off in the php.ini

safe_mode = false

(that is correct yes?) and then restarted it, but it still says 'safe mode restrictions' etc

The problem with 'safe_mode_include_dir' is the fact that the php file that is created by the server ends up in the main folder for the site.
 
Man of Honour
Joined
31 Jan 2004
Posts
16,335
Location
Plymouth
And there you see the catch 22 which makes safe mode all but useless in most environments :)

Code:
safe_mode               =       Off
Should do the trick. It's just a boolean setting so theoretically 0, false should also work too o.o. Double check you're editing the main, one and only, correct php.ini :)
 
Associate
OP
Joined
18 Oct 2002
Posts
1,581
Location
Nottingham
i edited the main php.ini on the server and then did a find and found the site specific one, and that is already set to off?

safe_mode = Off

but it is throwing safe mode errors. How can this be?
 
Back
Top Bottom