|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77574 FPM failes to responed to apache2
Submitted: 2019-02-06 02:13 UTC Modified: 2019-02-06 19:47 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: martin dot barker at thisisbeacon dot com Assigned:
Status: Re-Opened Package: FPM related
PHP Version: 7.2.14 OS: Ubuntu 16.04.4 LTS
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-02-06 02:13 UTC] martin dot barker at thisisbeacon dot com
This is a pain to replicate but spent 2 hours with AWS engineers (plural) working this one out.

Load Balancer to Apache2 to PHP7.2-FPM
Wordpress 5 - Database Connection error (Firewall / security group blocking access to Database)

PHP builds response and output and works correctly if you we used curl to the server curl with the "host:" header we could see the full HTML response generated by Wordpress.

When going via a Load Balance on AWS (Application Load Balancer) the underlying apache connection to the server was never closed so the load balancer just keep waiting for the connection to close before time out.

Test script:
Wordpress 5

Expected result:
When Wordpress handle the DB connection error and produces a complete error output it should close the connection to apache.

Actual result:
Seems to hang and leave the connection open meaning apache does not close it's connection correctly 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-06 02:30 UTC]
-Status: Open +Status: Not a bug
 [2019-02-06 02:30 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Besides the fact that the problem clearly appears to be with the LB, this is too complicated to deal with on a bug tracker. Too many variables. If you can eventually track down the problem to something specifically with php-fpm (which has no knowledge of your LB because Apache is in between) then we can work from there.
 [2019-02-06 10:54 UTC] martin dot barker at thisisbeacon dot com
Wait your telling me a PHP Application not responding correctly is not a bug...

So what your deliberately leave the connection to apache2 open when it a handled error happens, even though no error it closes the connection correctly?
 [2019-02-06 11:09 UTC] martin dot barker at thissibeacon dot com
So just to be clear 2 members of staff at our side 2 AWS Engineering staff all looking into this problem for 4 hours.

We had tcpdump running, a static apache (HTML) site was working the whole time. so this was only happening when php was being used.

how we identified this was from the tcpdump we could see everything from the load balancer to the server was working. 
We could even see the server was sending the output content from PHP-FPM as it was created. 

The only problem was that the PHP-FPM handle waited for the socket timeout to occur Default of 60 seconds even though it has finished execution of the files. 

However, when the WordPress does not have a DB error it does not do the same site loads and responded in under 2 seconds.

So unless you're telling me that there is a bug in the Most Used PHP Application in the world in a specific case it errored created the output then but the process to sleep for more than 60 seconds before closing the connection. 

This is a PHP Bug, Apache2 works without PHP no Problem Apache2 is using the PHP Connector in FPM Mode. every part of where this error could be coming from is PHP Projects Code.
 [2019-02-06 11:21 UTC] martin dot barker at thisisbeacon dot com
 [2019-02-06 19:47 UTC]
-Status: Not a bug +Status: Re-Opened
 [2019-02-06 19:47 UTC]
Maybe I was mistaken but it sounded originally like you were saying that everything between Apache and PHP works fine unless you add a load balancer. Now you're saying that everything between the LB and Apache works fine unless you add PHP?
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Feb 23 00:01:25 2019 UTC