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.

Override php.ini in phpsuexec

Discussion in 'General Discussion' started by latpanel, Apr 17, 2005.

  1. latpanel

    latpanel Well-Known Member

    Joined:
    Jan 23, 2004
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    Using phpSuexec, every user could use his own php.ini and overwrite the "master" php.ini, so he could put registerglobals on or alter openbasedir and others.
    Is there any way to avoid that a user overwrite php.ini with his own php.ini? (Using phpsuExec, of course)

    Thanks
     
  2. LP-Trel

    LP-Trel Well-Known Member

    Joined:
    Oct 13, 2003
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Nirvana
    The only way to override this behavior is to patch PHP so it won't look outside the global php.ini.

    In main/php_ini.c look for

    /* Check CWD for php.ini */
    #define INI_CHECK_CWD

    change that to

    /* Check CWD for php.ini */
    /* #define INI_CHECK_CWD */

    and you will find that PHP will only obey the global php.ini. This cannot be turned on with a per website basis. ;)
     
Loading...

Share This Page