PHP safe mode, openbase_dir, and PHP SuExec

MscLimp

Active Member
Mar 3, 2003
35
0
156
Hi everyone,
I'm having a small problem here....
I have PHP safe mode on for my server, and a lot of people require it off...
I have PHP safe mode on because of the PHP scripts that can view other's files, ect.
I have heard that the openbase_dir can fix it...
Also, I have PHP SuExec on for my server, and this has never cause a problem for me.
I'm just wondering... would it be safe to turn off PHP safe mode, and turn on openbase_dir? Also, does openbase_dir cause any big problems that might get in people's way?
Thanks,
Greg

cPanel.net Support Ticket Number:
 

rs-freddo

Well-Known Member
May 13, 2003
832
1
168
Australia
cPanel Access Level
Root Administrator
I take it your primary request is how to turn off safe_mode for some sites.

create a text file called php.ini and place this line in it:
safe_mode = off
now upload to the directory where safe mode needs to be off.

I am assuming that you really are running phpsuexec.

Don't worry about open_basedir. If you don't want people to see files chmod them r-- --- ---. I think that's 400 (only readable by user) or 700 if it needs write and execute permission as well as read.

cPanel.net Support Ticket Number:
 

MscLimp

Active Member
Mar 3, 2003
35
0
156
Can you upload this via FTP, or do you have to do all this via SHH?

cPanel.net Support Ticket Number:
 

rs-freddo

Well-Known Member
May 13, 2003
832
1
168
Australia
cPanel Access Level
Root Administrator
Originally posted by MscLimp
Can you upload this via FTP, or do you have to do all this via SHH?

cPanel.net Support Ticket Number:
FTP is better as you won't have to chown files.

cPanel.net Support Ticket Number:
 

MscLimp

Active Member
Mar 3, 2003
35
0
156
Ok, and this php.ini file can be uploaded into the public_html directory?
Also, will this make the PHP open_basedir open so that person can view other's files?

cPanel.net Support Ticket Number:
 

rs-freddo

Well-Known Member
May 13, 2003
832
1
168
Australia
cPanel Access Level
Root Administrator
If you are using phpsuexec then the open_basedir tweak in WHM doesn't work anyway. Use permissions to stop people viewing others files. This has all been covered extensively in another post.

cPanel.net Support Ticket Number:
 

MscLimp

Active Member
Mar 3, 2003
35
0
156
Hi,
Couple clients try this php.ini thing but it didn't seem to work out...
Is there anything else you need to do to the file?
Just put it in the public_html, right?

cPanel.net Support Ticket Number:
 

rs-freddo

Well-Known Member
May 13, 2003
832
1
168
Australia
cPanel Access Level
Root Administrator
It doesn't act recursively, you need to put it in the directory the files reside in. If the files are in more than one directory you need to place it in all the directories the files reside in.

cPanel.net Support Ticket Number: