PHP FPM, EasyApache 4 and custom local php.ini

martin MHC

Well-Known Member
Sep 14, 2016
338
75
78
UK
cPanel Access Level
Root Administrator
I have read this thread:

PHP-FPM and PHP.INI

With answers given by @cPanelMichael but these answers are all now HTTP 404s -- the documents have gone.

I have found one document here:
PHP-FPM and EasyApache 4 - Version 60 Documentation - cPanel Documentation

But this is only for version 60 and unsure if /when this will also no longer be valid?

The document is just throwing options at me without explanation as to how to use these options or exampling how to write a correctly formatted PHP FPM instruction.

Further, I have TWO serious issues that

1) With PHP-FPM turned on, my heavily customised (core) PHP.ini file set up in EasyApache4 is not being loaded.

2) With PHP-FPM my account specific (local.ini) adjustments (session info. error logging etc.) is not being loaded.

I need both of these things operational with PHP-FPM ... or what's the point of PHP-FPM if it only loads the default php.ini?!


Therefore:

Please can an updated answer be given as to how to complete the two requests stated above?

Thanks.

Martin
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463

martin MHC

Well-Known Member
Sep 14, 2016
338
75
78
UK
cPanel Access Level
Root Administrator
@cPanelMichael Many thanks for this; I never realised that custom PHP.ini account-level directives can be placed using the EA PHP.ini Manager on the Cpanel account rather than on WHM centrally (or via ftp manual file uploads).

BUT:

The editor states:
The MultiPHP INI editor writes to the .htaccess, .user.ini, and php.ini files. The system will only write a directive to a file if it is a valid directive for that file type. For more information, read our MultiPHP INI Editor documentation.

I have looked at the documentation linked but it is ambiguous as to if it is HardCoded to edit .user.ini rather than editing the account-specific ini file specified in the core root php.ini .

For example:

my PHP.ini as set in WHM >> MultiPHP INI Editor :
user_ini.filename = ".account.ini"


So will the CPanel ini updates place changes in a .user.ini file or in an .account.ini file?

Cheers
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hi @martin MHC,

The procedure is different if you're using PHP-FPM. See this tutorial:

Tutorial - Managing php.ini directives with PHP-FPM

In general, you should never manually add or edit a .ini file within an account's home directory. Instead, you should use the MultiPHP INI Editor options in cPanel or Web Host Manager if you want to modify the PHP settings. Or, if you use PHP-FPM, see the tutorial linked above.

Thank you.
 
  • Like
Reactions: Rajeeva Lochana