MutliPHP Version Mismatch in .htaccess
I'm using MultiPHP Manager in cPanel and the domain correctly shows PHP7.2. If I run phpinfo(), I get the correct PHP version 7.2.13. Lastly, MultiPHP INI Editor shows "PHP Version ea-php72"
Now, inexplicably, the .htaccess file reads:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php56" package as the default "PHP" programming language.
AddType application/x-httpd-ea-php56 .php .php5 .phtml
# php -- END cPanel-generated handler, do not edit
2 Questions:
1. Why is the .htaccess file showing 5.6 but all indications are the site is using 7.2?
2. How is PHP executing the proper version that is shown in MultiPHP Manager when it's not the version in the .htaccess file?
To make things more interesting, in the subdomain, the .htaccess information is correct:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php72" package as the default "PHP" programming language.
AddType application/x-httpd-ea-php72 .php .php7 .phtml
# php -- END cPanel-generated handler, do not edit
If it's any help, these sites were recently migrated (using the cPanel Transfer tool).
-
As an additional note, cPanel's MultiPHP version control seems to work properly for controlling the version, as I explicitly changed to 5.6 and the phpinfo() then showed the correct version. I changed back to 7.2 and phpinfo() again showed the correct version. Meanwhile .htaccess remained 5.6 and the change date of the file was not altered (so, I'm assuming that the file was never changed). Where are these MultiPHP settings being stored? 0 -
So, here's some additional information. It appears that changes to php version made in cPanel are being set in httpd.conf using SetHandler. If this is correct, is there a way to override the PHP version on a per-directory basis (since it appears that the version defined in .htaccess is being disregarded in favor of the httpd.conf version) My old server ran mpm prefork and I don't see mod_proxy_fcgi as an option in Apache Modules. My new server is configured for mpm event and mod_proxy_fcgi is enabled. Is that the reason that MultiPHP is being defined in httpd.conf instead of .htaccess? 0 -
OK, for anyone else who runs into this, it appears that if you run PHP-FPM the changes will be made in httpd.conf, if you do not, the changes are made in .htaccess. This is new to me, but I'm guessing that the PHP-FPM needs to route all the request to the fcgi before it reaches .htaccess. Someone let me know if this is wrong or they can enlighten me further. 0 -
Hi @ocbox This is due to the fact that if you run PHP-FPM it uses it's own configuration files separate from what you'd use normally. The changes are made in one of the PHP-FPM specific configuration files (either globally or locally) and are added to the httpd.conf as an include. For example, it has its own list of disabled_functions apart from what's listed in a specific php version's .ini file. This would also affect directives specific to the .htaccess file. The resource here: may give you some insight as to how it's functioning globally as well as per account. Thanks! 0
Please sign in to leave a comment.
Comments
4 comments