EasyApache 4 MultiPHP INI Editor values ignored

kawasakai

Active Member
Sep 17, 2015
44
3
58
Germany
cPanel Access Level
Root Administrator
I have just upgraded from EA3 to EA4. When I now try to change some PHP Settings from the customer panel nothing happens. I tried for example to raise the memory_limit in the MultiPHP INI Editor, after that phpinfo still shows the default values.
The php.ini file in the customers home location and public_html/ is created with the customized values: 'memory_limit = 64M'

Nevertheless phpinfo shows the following:
memory_limit:
Code:
32M 32M
Configuration File (php.ini) Path:
Code:
/opt/cpanel/ea-php56/root/etc
Additional .ini files parsed:
Code:
/opt/cpanel/ea-php56/root/etc/php.d/bcmath.ini,
/opt/cpanel/ea-php56/root/etc/php.d/calendar.ini,
/opt/cpanel/ea-php56/root/etc/php.d/ctype.ini,
/opt/cpanel/ea-php56/root/etc/php.d/curl.ini,
/opt/cpanel/ea-php56/root/etc/php.d/dom.ini,
/opt/cpanel/ea-php56/root/etc/php.d/ftp.ini,
/opt/cpanel/ea-php56/root/etc/php.d/gd.ini,
/opt/cpanel/ea-php56/root/etc/php.d/json.ini,
/opt/cpanel/ea-php56/root/etc/php.d/mcrypt.ini,
/opt/cpanel/ea-php56/root/etc/php.d/mysqlnd.ini,
/opt/cpanel/ea-php56/root/etc/php.d/mysqlnd_mysql.ini,
/opt/cpanel/ea-php56/root/etc/php.d/mysqlnd_mysqli.ini,
/opt/cpanel/ea-php56/root/etc/php.d/pdo.ini,
/opt/cpanel/ea-php56/root/etc/php.d/pdo_mysqlnd.ini,
/opt/cpanel/ea-php56/root/etc/php.d/pdo_sqlite.ini,
/opt/cpanel/ea-php56/root/etc/php.d/phar.ini,
/opt/cpanel/ea-php56/root/etc/php.d/posix.ini,
/opt/cpanel/ea-php56/root/etc/php.d/simplexml.ini,
/opt/cpanel/ea-php56/root/etc/php.d/sockets.ini,
/opt/cpanel/ea-php56/root/etc/php.d/sqlite3.ini,
/opt/cpanel/ea-php56/root/etc/php.d/tokenizer.ini,
/opt/cpanel/ea-php56/root/etc/php.d/xml.ini,
/opt/cpanel/ea-php56/root/etc/php.d/xml_wddx.ini,
/opt/cpanel/ea-php56/root/etc/php.d/xmlreader.ini,
/opt/cpanel/ea-php56/root/etc/php.d/xmlwriter.ini,
/opt/cpanel/ea-php56/root/etc/php.d/xsl.ini
As I noticed there is no value indicating to load ini files from the users home location.

The .htaccsess file at public_html/ has the following content:
Code:
# BEGIN cPanel-generated handler, do not edit
<IfModule mime_module>
  # Use ea-php56 as default
  AddType application/x-httpd-ea-php56 .php
</IfModule>
# END cPanel-generated handler
 

JacobPerkins

Well-Known Member
May 2, 2014
617
97
103
cPanel Access Level
DataCenter Provider
Twitter
Hi,

The INI editors are simply a file editor of sorts. There's nothing in the system that ensures that PHP actually uses this INI file, that is still left up to the system administrator and account owner. You'll need to setup the stack and htaccess files appropriately for having that PHP.ini read and used.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Oct 25, 2016
2
0
1
USA
cPanel Access Level
DataCenter Provider
Sorry to dig up an older thread, but I am also having issues with this and the links that @cPanelMichael provided are not helpful to me. We are using LiteSpeed Web Server, CloudLinux, CageFS, SuPHP and EA4. Custom php.ini files are being completely ignored within the user's home directory or DocumentRoot of their web site.

Can anyone offer suggestions or tips? Running WHM 58.0 (build 32). Thank you!

Best Regards,

Jason
 

nrm

Member
PartnerNOC
Jan 11, 2007
16
0
151
Moscow, Russia
Can anyone offer suggestions or tips? Running WHM 58.0 (build 32). Thank you!

Best Regards,

Jason

I have same trouble, open ticket 7832861 and that's what I know from cPanel support:

Hello,

I believe this issue happens becuase the MultiPHPini editor has been saved from inside of the WHM. Changes saved in WHM for PHPINI cannot be overridden by a website php.ini.

===
[23:26:04 srv [email protected] ~]cPs# mv /opt/cpanel/ea-php56/root/etc/php.d/local.ini{,.cPbak}
===

After resolving the above issue by removing the file that prevents setting from being overwritten, looks like the cagefsctl is preventing the account from enabling that specific option. If I disable cagefs for account USERNAME it works as expected.

So, do you using cagefs and/or do you edit php.ini via WHM MultiPHPEditor? That is the problem i guess...
 
Oct 25, 2016
2
0
1
USA
cPanel Access Level
DataCenter Provider
Thank you, @nrm. I've tried disabling CageFS for the user I'm testing with and I also got rid of the local.ini file, but still no go. BuycPanel / cPanel has advised that it is a bug:

We have an open internal case regarding this issue. The case ID is EA-5148 and presently doesn't have an ETA. The only work around at this point is to change the PHP setting globally so that /opt/cpanel/ea-phpxx/root/etc/php.d/local.ini is updated. If you'd like to get an update in the meantime please feel free to contact us with the mentioned bug ID. You may also want to follow our changelog via http://go.cpanel.net/changelog

Highest Regards,

Kailas B
cPanel© Certified
- Jason
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello,

Here's the information from our The cPanel PHPRC PHP Patch for EasyApache 4 - EasyApache 4 - cPanel Documentation document:

Overview
In cPanel & WHM version 58, we created a PHP patch that forces an EasyApache 4 system to read its php.ini files in the same order as an EasyApache 3 system.

Patch behavior
Your system's PHP handler determines how your system behaves with this patch and which global values the system uses.

If you use the CGI or DSO PHP handler, the system uses the global values that the /opt/cpanel/ea-php##/root/etc/php.d/local.ini and /opt/cpanel/ea-php##/root/etc/php.d/*.ini files define. If your system uses the suPHP PHP handler, the presence of the suPHP_ConfigPath directive determines whether the system reads the .ini files in the /opt/cpanel/ea-php##/root/etc/php.d/ directory.

Your PHP handler determines your system's behavior:

CGI or DSO
The system only uses the values that the /opt/cpanel/ea-php##/root/etc/php.ini file or the.ini files in the /opt/cpanel/ea-php##/root/etc/php.d/ directory specify.

SuPHP
If you do not set the suPHP_ConfigPath directive in your .htaccess file, the system loads the values in your php.ini files and the values in the local.ini files in the /opt/cpanel/ea-php##/root/etc/php.d directory. If a user-defined php.ini file exists, the system will override the values that the files in the /opt/cpanel/ea-php##/root/etc/php.d/ directory set.

If you set the suPHP_ConfigPath directive in your .htaccess file, the system does not load configurations in the /opt/cpanel/ea-php##/root/etc/php.d/ directory. Instead, it loads the settings in the php.ini file that the directive specifies. The php.ini file that the directive specifies takes precedence over the global configuration file.

Important:

If you set the suPHP_ConfigPath directive, the specified php.ini file must be a complete .ini file.

To ensure that your users receive a complete php.ini file, run the following command to combine your existing files:

cat /opt/cpanel/ea-php##/root/etc/php.ini /opt/cpanel/ea-php##/root/etc/php.d/*.ini > /path/to/specified/php.ini
Could you provide an example of a scenario where this is working differently to what's documented? Please provide specific step-by-step instructions on how to reproduce the issue, and include the PHP handler utilized by the account.

Thank you.
 

XxUnkn0wnxX

Member
Feb 3, 2014
22
0
1
cPanel Access Level
Website Owner
could not get it to work even with this in my htaccess file with the php.ini in the directory i placed it in

<IfModule mod_suphp.c>
# Loads the module mod_suphp.c
suPHP_ConfigPath /home/Admin/public_html
# Specifies the path of the php.ini file. Use your legitimate path.
<Files php.ini>
# Specifies the file php.ini
order allow,deny
# This is ordering to check the allowed list first then the deny list.
deny from all
# Denies everyone from viewing the file specified above
</Files>
# Closes the files tag
</IfModule>
# Closes the modular line

had to cd into /opt/cpanel/ea-php70/root/ete (since i'm on PHP 7)

then mv php.ini php.ini.bak

ln -sf /opt/cpanel/ea-php70/root/etc/php.d/local.ini /opt/cpanel/ea-php70/root/etc/php.ini

now all changes made in local.ini are effective ;)

but unsure what happens to the php.ini file in /opt/cpanel/ea-php70/root/etc/ when PHP is rebuilt or updated though, Why Doesn't Cpanel have an option to force use of custom directory for php.ini? For All Php Handlers & Versions, like an explicit Php.ini path that must be followed.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Why Doesn't Cpanel have an option to force use of custom directory for php.ini? For All Php Handlers & Versions, like an explicit Php.ini path that must be followed.
Hello,

The cPanel MultiPHP INI Editor will write to .user.ini files as well as php.ini files starting in cPanel version 62. This will help to alleviate problems where changes made via this interface don't take affect.

Thank you.