Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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:
    166
    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. ;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice