• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

PHP version for applications above web root

DylanJ

New Pleskian
I am running an application for which I was told for security purposes to install the application files in a folder above the web root (httpdocs) so they are in Home directory > application folder.

I assumed that the application would be running the same PHP version as the vhost which I have set to be 5.6.15 fpm served by nginx (as is the entire subscription). PHPinfo in the httpdocs folder confirms that it is running 5.6.15 as expected. However, the application reports that it is running on 5.4.45 on Apache.

Also, if I go to the subscription and "customise" then "PHP settings" it also tells me that my current PHP version is 5.4.45.

How can I change the default version to the one I want or will it always default to the OS vendor PHP version?
 
I now realise that this is a problem inside of the web root too. If I enable 5.6.15 PHP-FPM served by nginx the application reports that the PHP version is running on Apache version 5.4.45 but if I enable 5.6.15 as Fast CGI application served by Apache the application reports that PHP version 5.6.15 is being used.

Obviously for some reason PHP-FPM isn't working properly, can someone shed some light on why this is the case, please?

(btw I'm using version 12.5)
 
On further investigation, I'm beginning to suspect that Yii framework is the problem, has anyone managed to configure nginx vhosts to work with it?
 
Hi DylanJ,

any solution for that? I face a similar issue after installing nginx/php-fpm: Just executing a php info e.g. from the default test folder (under the web root) works fine with version 5.6.x - however if I create a new folder next to it and reexecute the same php info it returns me php 5.3.3 (default by Apache) . The PHP settings are clearly set to the nginx/fpm combination. Why do both PHP handlers interfere here?
 
Hi DylanJ,

any solution for that? I face a similar issue after installing nginx/php-fpm: Just executing a php info e.g. from the default test folder (under the web root) works fine with version 5.6.x - however if I create a new folder next to it and reexecute the same php info it returns me php 5.3.3 (default by Apache) . The PHP settings are clearly set to the nginx/fpm combination. Why do both PHP handlers interfere here?

I found my problem to be caused by nginx directives not being configured correctly. Then, what was happening was that .htaccess files were picking up the requests that nginx missed and obviously Apache was processing them and defaulting to the OS vendor version of PHP. Because the application appeared to be working ok I thought all was set up correctly but it was clearly not the case!
 
Back
Top