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.

suPHP_ConfigPath not working

Discussion in 'General Discussion' started by johny_gjx, Aug 14, 2008.

  1. johny_gjx

    johny_gjx Active Member

    Joined:
    Apr 15, 2005
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    We've been using suPHP for a while and now decided to put php.ini custom config files where users normally won't have access to.

    we do:

    Code:
    mkdir -p /usr/local/apache/conf/userdata/std/2/user/domain
    and put a suphp.conf in that directory and put these lines inside the file:

    Code:
    <IfModule mod_suphp.c>
    suPHP_ConfigPath /root/users/user
    </IfModule>
    and:

    Code:
    /scripts/ensure_vhost_includes --user=user
    service httpd restart
    
    inside the /root/users/user there is a php.ini with a setting however this setting does not apply when we check through

    Code:
    lynx --dump http://domain/info.php | grep -i setting
    the output is not affected by the /root/users/user/php.ini


    Also /usr/local/cpanel/bin/rebuild_phpconf --current outputs:

    Code:
    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled
    the bottom of "/opt/suphp/etc/suphp.conf" looks like:

    Code:
    [phprc_paths]
    ;Uncommenting these will force all requests to that handler to use the php.ini
    ;in the specified directory regardless of suPHP_ConfigPath settings.
    ;application/x-httpd-php=/usr/local/lib/
    ;application/x-httpd-php4=/usr/local/php4/lib/
    ;application/x-httpd-php5=/usr/local/lib/
    as you see it should not ignore the suPHP_ConfigPath settings as the lines are commented.

    what could be the reason?
     
    #1 johny_gjx, Aug 14, 2008
    Last edited: Aug 14, 2008
  2. johny_gjx

    johny_gjx Active Member

    Joined:
    Apr 15, 2005
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    anyone has any idea how this situation can be debugged? I mean how to pinpoint where the problem is? I tired to fetch both ENV and PHP variables and init setting through php to see if suPHP_ConfigPath is found to be set or not without any success.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Ensure PHP can access the php.ini file in /root/users/user
     
  4. kistler

    kistler Well-Known Member

    Joined:
    Jan 27, 2005
    Messages:
    136
    Likes Received:
    0
    Trophy Points:
    16
    This is most likely the case as I am able to do every step you have but the location of the custom php config is in a accessible directory for php. This works just fine.
     
  5. johny_gjx

    johny_gjx Active Member

    Joined:
    Apr 15, 2005
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    Yes I did change the directory path and also from:

    Code:
    <IfModule mod_suphp.c>
    suPHP_ConfigPath /root/users/user
    </IfModule>
    I removed the first and the last line, so it is now:

    Code:
    suPHP_ConfigPath /path/to/user/config
    but as far as I remember just changing the directory path did not work.
     
  6. anilg

    anilg Member

    Joined:
    Oct 15, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    india
  7. qlites

    qlites Member

    Joined:
    Oct 13, 2003
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Any luck placing the php.ini outside the users directory? I would like to prevent the user to be able to edit their own php.ini files. Is there anyway around this? What do others do to provide custom php.ini without allowing the user full access? Any ideas would be greatly appreciated.
     
  8. jack01

    jack01 Well-Known Member

    Joined:
    Jul 21, 2004
    Messages:
    200
    Likes Received:
    0
    Trophy Points:
    16
    I would aslo like to know this...
     
  9. johny_gjx

    johny_gjx Active Member

    Joined:
    Apr 15, 2005
    Messages:
    42
    Likes Received:
    0
    Trophy Points:
    6
    The mentioned steps should work, but use a better path for storing the user's php.ini, also you can put a few line together and make a script that does the config change, creates a copy of the php.ini to that directory and restarts the webserver.
     
Loading...

Share This Page