• 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

Issue Apache defaults to using PHP 5.4 to process requests

OlgaKM

Basic Pleskian
I have been trying to use nginx + PHP-FPM as much as possible on my server because of its efficiency, but have run into an issue. When Apache URL re-writing is used, Apache takes over the handling of the PHP script. I understand this (and setting up nginx URL re-writing is a whole another issue). The problem is, if a virtual host is set up to use nginx + PHP-FPM but a request ends up going to Apache, Apache uses PHP 5.4 to handle the request, even though PHP 7 is installed on the server! If I switch handling to Apache + FastCGI PHP, it uses PHP 7. But if I switch back to nginx + PHP-FPM, Apache starts using PHP 5.4 again. PHP 5.4 is of course far less efficient than PHP 7

I am considering simply setting up a symlink from /usr/bin/php-cgi to /opt/plesk/php/7.0/bin/php-cgi. Would this work to resolve the issue?
 
Hi OlgaKM,

you may do whatever you would like to on your server... it's YOUR choice. But pls. keep in mind, that you might have just forgotten to enable the corresponding PHP - module. Pls. check you settings at for example: => HOME > Tools & Settings > Apache Web Server
 
Well yes, I understand I'm free to do whatever I like. I'm asking for the method that would involve the least "hacking" of stock Plesk :)

I looked under Home > Tools & Settings > Apache Web Server, but I'm not sure what I'm looking for. It lists the enabled and disabled Apache modules. I'm not sure how this is relevant to my question.
 
Hi OlgaKM,

I'm not sure how this is relevant to my question.
Well, I could give you the screenshot example of a server, where PHP 5.6, 7.0 and 7.1 is installed ( as vendor versions ):

Plesk-Onyx_Apache_Web_Server_PHP-modules_01.png

As you can see, we have the option to choose between three modules installed on this server.

YOU stated:
even though PHP 7 is installed on the server!
... then you should not only have a standart "php" ( => PHP 5.4 ) option, but as well an option for your installed "PHP 7" - apache module. ;)



The additional PHP handlers from Plesk for example ( version 5.2 - 7.1 ), have no apache - module and therefore there is no option to change the php - module for your apache webserver on your server.
 
I see. On my server that page lists only "php5" and "php5-zts". I installed PHP 7.0 using Plesk's "Add or Remove Components".
 
Back
Top