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 Configuration Per Domain

Discussion in 'General Discussion' started by DarvinDenmian, Nov 27, 2008.

  1. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I need to know how to set the policy of PHP "php_admin_value session.save_path" per domain. :confused: ??

    What I found was this policy established in the global configuration of PHP, but this is not what I want.

    Thanks.
     
  2. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    how is your php environment set up? do you have phpsuexec/suphp or dso?
     
  3. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    PHP is UP and Running.
    Apache suEXEC on
     
  4. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    what about PHP itself, what is the php handler? suphp or dso?
     
  5. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    suphp is enabled
     
  6. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    In which case your only option is to put a customised version of php.ini in each users public_html folder. (This is assuming suphp is configured to allow the override of config files) however this is a BIG security issue, and not something you should consider doing if it can be avoided.

    NOTE: It has to be a complete php.ini file in the users public_html, not just overrides.

    If you have ini_set enabled you can override the tmp dir setting in scripts themselves rather than allowing a completely different config file to be created.
     
  7. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    there is a alternative to this issue?
     
  8. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    We currently use vhcs, and I can set some policies per domain.
    Below the example of what I have today:

    php_admin_value open_basedir "/includes/website/:/var/www/virtual/<DOMAIN_NAME_HERE>/:/usr/share/php/:/tmp/"

    php_admin_value safe_mode on
    php_admin_value safe_mode_include_dir "/includes/website/"

    php_admin_value include_path ".:/includes/website/:/var/www/virtual/<DOMAIN_NAME_HERE>/of_config/"

    php_admin_value register_globals off
    php_admin_value session.save_path "/var/lib/php5/<DOMAIN_NAME_HERE>"
     
    #8 DarvinDenmian, Nov 27, 2008
    Last edited: Nov 27, 2008
  9. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    continuing ....

    I need to set up these policies through CPanel.
    Is there a way to do that?
    Sorry about the complication
     
  10. DarvinDenmian

    DarvinDenmian Member

    Joined:
    Nov 27, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
  11. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    under suphp none of those directives are valid, they will only work with the php handler being dso
     
  12. bazzii

    bazzii Member

    Joined:
    Jun 17, 2008
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    You can check this via multiple ways...

    1. Edit your .htaccess file

    add : php_flag session.save_path = /tmp

    2. Edit your .htaccess file

    add : </IfModule mod_php5.c> [assuming php version is 5]
    php_flag session.save_path = /tmp
    </Ifmodule>

    3. Put a php.ini file in your public_html

    add the directive there.. Check the path of Configuration File (php.ini) on a phpinfo page .. If its your php.ini under your home directory, You can do further modification.

    hope this will help
     
  13. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,460
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The above will not work with suPHP, which is what DarvinDenmian stated is in use.

    @DarvinDenmian, if you search the foru, there are a few threads explaining how to use custom php.ini files with suPHP without giving users access to the php.ini file. It involves a configuration directive for suPHP.
     
Loading...

Share This Page