Here's a variety of things I came across while implementing the tutorial, researching online and referring to posts made by other cPanel users who had already gone down this path.
• Either replace Step 6b’s code with the following or indicate that Apache 2.4.10+ users should use this code instead for better compatibility.
Code:
<IfModule proxy_fcgi_module>
<FilesMatch "\.php$">
SetHandler "proxy:unix:/home/$<user>/run/php56-fpm.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
• Step 6b might also mention that the fpm.conf can be placed in the <useraccount> folder to set a default PHP-FPM config for all domains for that user account. fpm.con files placed in <useraccount>/<vhost> as directly would still override the default for the useraccount. This just speeds up the manual configuration process when setting up a bunch of accounts.
• Step 2 should also indicate to create a session folder
Code:
mkdir -p /home/$<user>/tmp/session
…or another folder if cPanel prefers something different. The sessions need a user-owned folder to write.
• Step 4f
Change the Session save path to the folder created above.
Code:
php_value[session.save_path] = /home/$<user>/tmp/session
• After Step 4d
I’d recommend either mentioning the following setting or recommending it especially for servers with a lot of accounts so that initial memory consumption is a lot less before more advanced configuration is made. The “dynamic” default launches a minimum of 1 pool per user, while “on demand” only launches the pools as needs and sticks around for the amount of time set by “pm.process_idle_timeout”. Previous FCGID users should find these options similar.
Some in general notes...
• The php.ini’s as configured within WHM do not apply and must be manually configured at the following locations. These are individually set per PHP version.
Code:
/opt/cpanel/ea-php56/root/etc/php.ini
/opt/cpanel/ea-php55/root/etc/php.ini
/opt/cpanel/ea-php70/root/etc/php.ini
• If you want to make use of the OPCache ini to activate and configure, go here:
Code:
/opt/cpanel/ea-php56/root/etc/php.d/opcache.ini
/opt/cpanel/ea-php55/root/etc/php.d/opcache.ini
/opt/cpanel/ea-php70/root/etc/php.d/opcache.ini
• Right now as instructed the OPCache is shared amongst all sites running the same version of PHP. You may want to move in the direction of setting up master processes per user so the OPCache is only shared amongst each user account alone. This would be a much more complex config but likely more secure. Reloading or Restarting the FPM Master processes would be more difficult as well, but I’m sure a script could facilitate that once FPM is integrated into EasyApache.
• Some script options to be aware of as shown in Step 5. If you’ve made changes to the conf files you can do a Reload to apply those changes. This waits for current pool processes to complete before reloading. This resets the OPCache as well.
Code:
/etc/init.d/ea-php70-php-fpm reload
/etc/init.d/ea-php55-php-fpm reload
/etc/init.d/ea-php70-php-fpm reload
If you’ve made changes to the main php.ini files you need to do a Restart to apply those changes. This also applies the conf changes and OPCache reset.
Code:
/etc/init.d/ea-php70-php-fpm restart
/etc/init.d/ea-php55-php-fpm restart
/etc/init.d/ea-php70-php-fpm restart
• I also noticed that the WHM / cPanel interface for creating the user’s php.ini file creates a php.ini file as expected, but the main php.ini for each version of PHP is not actually configured to use it so it doesn’t work by default. Setting the following fixes that.
Code:
user_ini.filename = "php.ini"
• Also since FPM currently required manually configuration for changes, I looked to disable the MultiPHP Manager in the Feature Manager while keeping the MultiPHP INI Editor active, but unfortunately disabling MultiPHP Manager disables both sections from appearing. This will be moot once FPM is fully integrated.