Skip to main content

MutliPHP Version Mismatch in .htaccess

Comments

4 comments

  • ocbox
    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
  • ocbox
    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
  • ocbox
    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
  • cPanelLauren
    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.