celiac101

Well-Known Member
Dec 19, 2012
101
1
68
cPanel Access Level
Website Owner
Last night I turned on PHP-FPM on my sites that run PHP 7. I was using SUPHP. I did this in
Home »Software »MultiPHP Manager
and all seems to be fine.

However, I see that my PHP handler for PHP 7 is still set to SUPHP, so maybe I haven't made the switch yet? What should my PHP handler be for PHP-FPM--my choices are CGI, None or suPHP (I run memcached as well)?

Also, when I go to change the handler I get a warning:
"Changes to this “PHP” version’s handler may cause errors for the domains that use it."
Is it ok to change this on a very busy live site with lots of php stuff going on?
 

cPanelMichael

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

PHP Handlers do not apply to PHP-FPM. Once you enable PHP-FPM for an account, that becomes it's handler and thus the default PHP handler you enable for a version of PHP no longer applies to that account.

If you've enabled PHP-FPM for all accounts, then it doesn't matter what you configure as the PHP handler for a version of PHP, because the accounts will instead use PHP-FPM (no matter what's configured as the handler).

Thank you.
 

celiac101

Well-Known Member
Dec 19, 2012
101
1
68
cPanel Access Level
Website Owner
Thank you for that explination. So now my problem is that I have some applications that are in separate directories that need to run on PHP 5.6, instead of PHP 7. Before I used the code below in an .htaccess file to make that directory use PHP 5.6. Is there any way to do this now that I am on PHP-FPM ?

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
So now my problem is that I have some applications that are in separate directories that need to run on PHP 5.6, instead of PHP 7. Before I used the code below in an .htaccess file to make that directory use PHP 5.6. Is there any way to do this now that I am on PHP-FPM ?
PHP-FPM is controlled through the Apache virtual host, so while it's possible to enable a different PHP version on a addon domain or subdomain, it's not configurable on a per-directory basis. You'd need to create a subdomain for that directory and access it via the subdomain in the address bar of your browser if that's the behavior you are seeking and you want to continue using PHP-FPM.

Thank you.
 

celiac101

Well-Known Member
Dec 19, 2012
101
1
68
cPanel Access Level
Website Owner
Would you happen to have an example of the code required in the Apache virtual host to make a virtual directory keep using PHP 5.6? For example, I have one folder that is in a subdomain without www, so it uses domain123.com instead of www.domain123.com. The example directory name off root is /advertising

Please let me know.
 
Last edited:

cPanelMichael

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

We currently only support updating the PHP version on a per-domain or per-subdomain basis when PHP-FPM is enabled. You'd need to setup a separate subdomain for each application that requires it's own PHP version and assign it that specific version using the MultiPHP Manager option in cPanel or WHM.

Thank you.