2

With EasyApache3 and Php5.4, the server was setup whereby the parameter values in the master php.ini file could be adjusted per account using a local php.ini file located in the account root. Having upgraded to EasyApache4 and Php 5.6 this configuration structure does not seem to be working, the local php.ini file shows as loaded in phpinfo.php but the parameters set do not change the master values eg:

post_max_size 20M 

And ideas please?

Nick W
  • 877
  • 2
  • 15
  • 30
  • I had same issue. Did you restart your apache after doing the changes??? – Abizz Feb 22 '17 at 12:54
  • Yes I did restart Apache. – Nick W Feb 22 '17 at 12:59
  • @Nick: Did you try to put php.ini in your project folder so it may overwrite configuration of an server configuration. – Dipak Feb 22 '17 at 13:03
  • Yes and phpinfo.php showed that local php.ini file path as loaded but local values unchanged. – Nick W Feb 22 '17 at 13:04
  • @Nick :Please follow below links that will definitley help to resolve your issue. https://documentation.cpanel.net/display/CKB/How+to+Edit+Your+php.ini+File – Dipak Feb 22 '17 at 13:12
  • https://documentation.cpanel.net/display/ALD/MultiPHP+INI+Editor+for+WHM – Dipak Feb 22 '17 at 13:12
  • Because in specific easyapache2 you should overwrite php.ini with local.ini which place in your project's root folder. – Dipak Feb 22 '17 at 13:14
  • @Nick : This may also helpful to you : https://bobcares.com/blog/custom-php-ini-cpanel/ – Dipak Feb 22 '17 at 13:15
  • 1
    @Dipak:Thanks for the links, in particular the last one which I'm hoping will solve the issue. In WHM > MultiPhp Manager suphp appears to be set as the Php handler for ea-php55, and the server-wide php.ini exists in opt/cpanel/ea-php56/root/etc/php.ini BUT it looks like /opt/cpanel/ea-php56/root/etc/php.d/local.ini is missing! – Nick W Feb 22 '17 at 13:45
  • @Nick: Yes, because easyapache4 have tricky way to overwrite php.ini configuration. – Dipak Feb 22 '17 at 13:46
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/136361/discussion-between-dipak-chavda-and-nick-w). – Dipak Feb 22 '17 at 13:46
  • The local.ini file is now in place and the user ini in public_html/php.ini has been generated by WHM and is editable via Cpanel, it works differently to EA3, this ini seems to require more than just custom values, it has to be present else it breaks the site. The custom values in the user ini now show in phpinfo, but in both columns, and they don't seem to be effective eg memory_limit is set to 255M but a backup process still errors out at 33554432 bytes ie 33.6MB! – Nick W Feb 23 '17 at 11:51
  • There's now also a .user.ini file in public_html and if that contains just one value eg memory_limit = 256M then that will change the value shown in phpinfo in the 'local value' column without restarting Php. However I still don't think it is taking effect, perhaps I'll try altering another value. – Nick W Feb 23 '17 at 12:14
  • Confused now because on another domain the MultiPhp ini editor has written a php.ini file to public_html which only contains custom values and the site still works, ie no need for an extensive list of values like on the other domain; maybe the 'main' ini path setting differs. So how is user.ini meant to be used in relation to the local php.ini? – Nick W Feb 28 '17 at 12:01
  • However I've increased the memory_limit setting and it's not showing the increase in phpinfo, not in either column. – Nick W Feb 28 '17 at 12:10

1 Answers1

1

With EA4 by default there's one server-wide php.ini located at /opt/cpanel/ea-php56/root/etc/php.ini but when the MultiPhp Editor is used I believe it creates ini files at /opt/cpanel/ea-php56/root/etc/php.d/local.ini, public_html/php.ini, and public_html/.user.ini where the hierarchy is:

php.ini > local.ini > .user.ini

So .user.ini over-rides local.ini which over-rides the server-wide php.ini

Although the MultiPhp editor creates it, public_html/php.ini seems not to be used as long as user_ini.filename is not set, since the default for user_ini.filename is .user.ini, and as long as there is not a directive in .htaccess

Ref: https://forums.cpanel.net/threads/ea4-php-ini-local-ini-behavior.559871/

Nick W
  • 877
  • 2
  • 15
  • 30