The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP safe mode, openbase_dir, and PHP SuExec

Discussion in 'General Discussion' started by MscLimp, Aug 16, 2003.

  1. MscLimp

    MscLimp Active Member

    Joined:
    Mar 3, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    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:
     
  2. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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:
     
  3. MscLimp

    MscLimp Active Member

    Joined:
    Mar 3, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Can you upload this via FTP, or do you have to do all this via SHH?

    cPanel.net Support Ticket Number:
     
  4. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    FTP is better as you won't have to chown files.

    cPanel.net Support Ticket Number:
     
  5. MscLimp

    MscLimp Active Member

    Joined:
    Mar 3, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    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:
     
  6. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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:
     
  7. MscLimp

    MscLimp Active Member

    Joined:
    Mar 3, 2003
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    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:
     
  8. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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:
     
  9. robert2807351

    robert2807351 Member

    Joined:
    Oct 11, 2004
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    #9 robert2807351, Oct 12, 2004
    Last edited: Oct 12, 2004
Loading...

Share This Page