proxy: error FCGI: attempt to connect to failed

I think, this is a huge bug introduced by this “Fixing port clash for PHP-FPM version” task. This breaks all virtualhosts again.
I only have PHP 7.2 on Ubuntu 18.04 and this broke all my virtualhosts.

Unfortunatly I’m not able to switch back to PHP FCGI. Eventhough everything seems to be correct setup, it still trys to connect via proxy to php-fpm.


@ayalon - I’m back to CGI wrapper, even if I have a performance impact, better slower then offline …

I’ll wait for an update from Virtualmin

I had to rename

/etc/apache2/conf-available/php7.2-cgi.conf.conf to /etc/apache2/conf-available/php7.2-cgi.conf_disabled

/etc/apache2/conf-available/php7.2-fpm.conf to /etc/apache2/conf-available/php7.2-fpm.conf_disabled

Then sudo service apache2 restart.

This allowed me to switch to FCGI instead of PHP-FPM as a workaround.

@Mad_Turnip: Will do the same and switch everything to FCGId. It’s better that beeing offline.

I register to comment…

I do have same issue… using Ubuntu 18.04… have to go to website option, change to fcgi then back to fpm to make the webaite back online. The same with what others do.

Hope will fixed soon…

I have the same issue on centos 7.6, terrible this.

I fix ot switching from php 7.2 to php 5.6 and works inmediately, then I can change again to php 7.2

probably until the next check config script.

I think i too am having a similar issue. twice now after running virtualmin updates in the last month, php stops functioning after restart. The fix has been to go to just one of my VirtualServers>website options> change from FPM to FCGI and back again.

As soon as i do this, php starts working again.

I have made a post about mine in the Issue Tracker

Yes, or the next reboot.

Someone know how to fix this? I have the correct ports between virtual servers in apache and his php-fpm pool but I can’t make it working if I don’t change mode or php version.

Thank you

same issue here. everytime I update virtualmin i have this problem.

i cannot view this issue, adam

Maybe you should read the whole issue and apply the workaround? Switching back and forward does not help. Use FCGI. PHP-FPM is broken since almost a month now.

Hi again,

I think that I’ve located the problem, I’m going to try to explain it, sorry for my english.

I have Centos 7.x so the paths and versions conrrespond to this in my server.

I have two php versions availables, php 5.4 and php 7.2, the files of the pools for virtual servers are in:

5.4 path -> /etc/php-fpm.d/

7.2 path -> /etc/opt/rh/rh-php72/php-fpm.d/

When you use php 5.4 for a virtual server the file idvirtualserver.conf (123121232143xxx.conf) is in 5.4 path when you change to 7.2 that file is moved to 7.2 path. At this moment all works fine but there must be a cron or task that is changing internally this version 7.2 to version 5.4 and like the pool file isn’t just in 5.4 path the server crash, if you copy the file idvirtualserver.conf from 7.2 path to 5.4 path works again but with this version instead of selected.

Anyone knows what script runs when we are changing the version of php in a virtual server? and the script that is changing this when reboot or is running every x minutes?


I switched to fCGI. I don’t want to mess with workarounds.

Sorry I inadvertently marked it private. You can read it now.

I think there is some problem with the FPM version detection and the ‘port clash for PHP-FPM’ test that causes any update or ‘Re-check Configuration’ to change the FPM port number of each website. I have only one FPM version installed (7.2.3), but Virtualmin detects it as two:
The following PHP-FPM versions are available on this system : 7.2 7.2.3
The it changes the perfectly good and correct port numbers, breaking all the website. My example is below.

I have a fresh vanilla install of Virtualmin 6.07 on Ubuntu 18.04 with just one version of PHP (7.2.19) with PHP-FPM (7.2.3). It works fine until I run ‘Re-check Configuration’ and after that all PHP-FPM sites are broken.

Initially all is fine, the website config says:

<FilesMatch .php$>
SetHandler proxy:fcgi://localhost:8000

and /etc/php/7.2/fpm/pool.d/12345678901234.conf says:

listen = 8000

The website works great. Life is good. But every we time I run ‘Re-Check Configuration’ it says the following and all the PHP sites stop working:

The following PHP versions are available : 7.2.19 (/usr/bin/php-cgi7.2)

The following PHP-FPM versions are available on this system : 7.2 7.2.3

Fixing port clash for PHP-FPM version 7.2.3

Fixing port clash for PHP-FPM version 7.2.3

Restarting PHP-FPM server …
… done

Now the website config still says:

<FilesMatch .php$>
SetHandler proxy:fcgi://localhost:8000

But virtualmin has changed /etc/php/7.2/fpm/pool.d/12345678901234.conf to a different port!

listen = 8001

If I run ‘Re-Check Configuration’ it changes it to port 8002, and so on. Every time it changes the PHP-FPM port but does not update the website config.

If I manually change 800X back to 8000 and restart php-fpm that the website works again.

Seems like the FPM version check and ‘port clash for PHP-FPM’ clash detection is buggy?

This looks like the bug report, apparently fix will be to stop changing the port numbers:

I was able to go into the apache configuration for the website and remove this line SetHandler proxy:fcgi://localhost:8001 at that point I could then go into website options and change it to fpm or fcgid

has this been fixed at all yet?
I just had to perform a system reboot (after a kernel update to debian 9), and i put this reboot off for a while…after rebooting, the newest of my client wordpress websites went down with the following error in virtualmin>Logs and reports>apache error log

[proxy:error] [pid 1342:tid 140691015382784] (111)Connection refused: AH00957: FCGI: attempt to connect to (*) failed

not sure if the following has any relevance but i saw it on another forum post about this kind of error

netstat -tulpn | grep 8011
tcp6 0 0 :::8011 :::* LISTEN 3388/php-fpm: maste

this time, it appears that only one of the virtual servers php websites on my system went offline…the newest one (pain in the butt really because thats hardly a good look when a new client comes on board).

Also, all i had to do to get website backup again was goto Virtualmin>Server Configuration>Website Options and then simply click save (which restarted php-fpm for said website and it immediately came back online)

Perhaps there is some caching on other sites and not on new website…and i simply didnt wait long enough after reboot before checking wordpress websites to see if they were working or not?