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

sodapopinski

Well-Known Member
Aug 13, 2001
90
2
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.
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
96
78
India
cPanel Access Level
Root Administrator
Twitter
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..
 

cPWilliamL

cP Technical Analyst II
Staff member
May 15, 2017
258
30
103
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
 

sodapopinski

Well-Known Member
Aug 13, 2001
90
2
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.