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!

SOLVED How to restrict all accounts to the global php.ini file.

Discussion in 'Security' started by sodapopinski, Oct 17, 2017.

  1. sodapopinski

    sodapopinski Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    90
    Likes Received:
    2
    Trophy Points:
    308
    In easy apache3, to restrict all accounts to the global php.ini file, I would edit the /opt/suphp/etc/suphp.conf file and just

    Uncomment these lines:
    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/

    Now, since I use easyapache4 which support multi php version, the above trick does not work. Is there anyway to restrict all accounts to the global php.ini file?

    Thank you.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,834
    Likes Received:
    85
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    If you are using handler as SuPHP on your EA4 PHP, then you can do this the same way, only the suPHP location is changed. You can find it in /etc instead of /opt..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sodapopinski

    sodapopinski Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    90
    Likes Received:
    2
    Trophy Points:
    308
    Ah..thank you very much for the info @24x7server . I will try it. Thank you.
     
  4. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    29
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Just to follow up on this thread, the path is below:
    Code:
    # tail -13 /etc/suphp.conf
    ;Uncommenting these will force all requests to that handler to use the php.ini
    ;in the specified directory regardless of suPHP_ConfigPath settings.
    ;[phprc_paths], like suPHP_ConfigPath, is subject to php's PHPRC behavior.
    ;Before using this mechanism make sure to fully understand the implications
    ; of doing so:
    ;     https://go.cpanel.net/EA4PHPHandlers#PHPHandlers-Thesuphp.conffile
    ;     https://go.cpanel.net/PHPRC#ThecPanelPHPRCPHPPatchforEasyApache4-SuPHP
    ;application/x-httpd-ea-php54=/opt/cpanel/ea-php54/root/etc
    ;application/x-httpd-ea-php55=/opt/cpanel/ea-php55/root/etc
    ;application/x-httpd-ea-php56=/opt/cpanel/ea-php56/root/etc
    ;application/x-httpd-ea-php70=/opt/cpanel/ea-php70/root/etc
    ;application/x-httpd-ea-php71=/opt/cpanel/ea-php71/root/etc
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. sodapopinski

    sodapopinski Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    90
    Likes Received:
    2
    Trophy Points:
    308
    I got this fixed and understood how does new easyapache4 works ;p
    Long time never touch cpanel server configuration. Easyapache4 really new than easyapache3.
    You can mark this tread as solved now. Thank you.
     
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