[SOLVED] Using PHP-FPM generates 500 error, proxy : No protocol handler was valid for the URL /index.php...

4 posts / 0 new
Last post
#1 Thu, 07/25/2019 - 08:07
applejack

[SOLVED] Using PHP-FPM generates 500 error, proxy : No protocol handler was valid for the URL /index.php...

I have set up php-fpm using Remi safe php version 7.1 to 7.3 and SCL 7.0 but I am getting an internal server error when try to access the site using it

"proxy: No protocol handler was valid for the URL /index.php. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule."

All the proxy modules below are enabled and loaded in Apache.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

In httpd.conf

ProxyPassMatch ^/(..php(/.)?)$ fcgi://localhost:8000/home/domain/public_html/$1

This a WordPress site using the standard htaccess code.

Also even though I set the site to use php73 after changing to php-fpm it changed it to use 7.0 and using the php-fpm conf file from /etc/opt/rh/rh-php70/php-fpm.d/

I have run VM conf check and it says all the versions of php-fpm as above are available.

Centos 6.10 Apache 2.2.15 VM 6.06

Any help would be most appreciated. Thanks in advance.

Sat, 07/27/2019 - 08:54
applejack

After updating to VM 6.07 the switching of the versions of php now points to the correct php-fpm conf file but internal server error is still happening.

Sat, 07/27/2019 - 13:24
applejack

Apache 2.2 doesn't come with mod_proxy_fcgi which is why it is failing.

However you can get if from the epel repo then yum install mod_proxy_fcgi

add to httpd.conf

LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so

Restart httpd

Make sure that the version of php-fpm you want to use is running and set to start at reboot

Sun, 07/28/2019 - 18:14
jimdunn

Yep, I had same issue last night... I think I'm going back to FCGID and will let FPM mature a while longer.

The solution (workaround) is to change all domains to FCGID and back to FPM:

Step 1:

#!/bin/sh
mkdir /var/run/php
chown -R www-data:www-data /var/run/php
/usr/sbin/virtualmin modify-web --all-domains --mode fcgid
/etc/init.d/apache2 restart
/etc/init.d/php7.0-fpm restart

Step 2:

#!/bin/sh
mkdir /var/run/php
chown -R www-data:www-data /var/run/php
/usr/sbin/virtualmin modify-web --all-domains --mode fpm
/etc/init.d/apache2 restart
/etc/init.d/php7.0-fpm restart

(you might need to adjust the init.d lines, per your configuration)