Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Posts
    609

    Default How does Tweak PHP open_basedir Security work?

    How does Tweak PHP open_basedir Security work?

    I didn't see a change to the open_basedir setting in php.ini after enabling it in WHM, under Security Center.

    [~]# cat /usr/local/lib/php.ini |grep base
    ; open_basedir, if set, limits all file operations to the defined directory
    ;open_basedir =

    In what file is it changing that setting?

    TIA

  2. #2
    Member
    Join Date
    Jul 2008
    Location
    localhost
    Posts
    101

    Lightbulb

    Hi there,

    The changes would be made in the httpd.conf file. The entry will be added in the VirtualHost entry for the domain. A sample entry will look like

    <IfModule concurrent_php.c>
    php4_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    php5_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule !concurrent_php.c>
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule sapi_apache2.c>
    php_admin_value open_basedir "/home/username/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
    </IfModule>
    </IfModule>
    If you exclude php open_basedir for any of the account/domain the entry as above will be removed from the httpd.conf file.

  3. #3
    Member
    Join Date
    May 2008
    Posts
    1,203

    Default

    Quote Originally Posted by BianchiDude View Post
    How does Tweak PHP open_basedir Security work?

    I didn't see a change to the open_basedir setting in php.ini after enabling it in WHM, under Security Center.

    [~]# cat /usr/local/lib/php.ini |grep base
    ; open_basedir, if set, limits all file operations to the defined directory
    ;open_basedir =

    In what file is it changing that setting?

    TIA
    PHP's open_basedir protection prevents users from opening files outside of their home directory with PHP script. Since you have enabled Open_basedir security from WHM, php.ini will show you as below:

    ; open_basedir, if set, limits all file operations to the defined directory
    ;open_basedir =

    This is a correct settings and I do not think you need to do anything else now. Are you facing any problems?

  4. #4
    Member
    Join Date
    Jul 2008
    Location
    localhost
    Posts
    101

    Default

    Quote Originally Posted by thewebhosting View Post
    PHP's open_basedir protection prevents users from opening files outside of their home directory with PHP script. Since you have enabled Open_basedir security from WHM, php.ini will show you as below:

    ; open_basedir, if set, limits all file operations to the defined directory
    ;open_basedir =

    This is a correct settings and I do not think you need to do anything else now. Are you facing any problems?
    yes, that is true.. but if you change it in WHM under Security Center, changes do reflect in httpd.con file.

Similar Threads & Tags
Similar threads

  1. Security: open_basedir for cPanel
    By nettigritty in forum Feature Requests for cPanel/WHM
    Replies: 5
    Last Post: 05-18-2011, 01:15 PM
  2. php open_basedir security
    By gdwebhosting in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-03-2007, 10:19 PM
  3. open_basedir security etc
    By protocol in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-16-2004, 04:44 AM
  4. SMTP Tweak in whm/ tweak security
    By 10101 in forum cPanel and WHM Discussions
    Replies: 19
    Last Post: 02-24-2004, 12:59 PM
  5. Tweak Security: PHP Open_basedir Not Working
    By mmkassem in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 08-09-2003, 08:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube