Red Hat Bugzilla – Bug 1302797
PHP-FPM incorrectly handle Apache 2.4.x FastCGI Request OR HTTPd apache incorrectly send SCRIPT_FILENAME values.
Last modified: 2016-11-04 04:10:40 EDT
Description of problem:
As correctly described on this merge request: https://github.com/php/php-src/pull/1197/files
PHP in FPM mode do not handle properly balancer/FastCGI requests coming from an HTTPd Apache 2.4 using the SetHandler directive.
Version-Release number of selected component (if applicable):
PHP-FPM 5.4.16 - Apache 2.4
Steps to Reproduce:
1.Configure a vhost with mod_vhost_alias.
2.Set a FileMatch directive catching php extension.
3.Set a SetHandler directive on the FileMatch section which delegate to a balanced proxy setup.
HTTP Result: 404 - File Not Found
HTTP Result: 200 - OK
If you take a look at the received packet on PHP-FPM, you'll clearly see that the SCRIPT_FILENAME variable contain bad informations.
Here is the sanitized content of the packet:
As you can see it, the SCRIPT_FILENAME variable should rather have been filed without the proxy:balancer://compute/ information coming from Apache.
Many thanks for the fix, I still have to test and validate it on our platform. I'll update this ticket accordingly.
Hi guys, any idea, when this fix will made its way to the upstream repository?
It kinda became quite important to have this feature for us to operate safely our PHP Base application.
(In reply to gael THEROND from comment #8)
> Hi guys, any idea, when this fix will made its way to the upstream
> It kinda became quite important to have this feature for us to operate
> safely our PHP Base application.
have you meant, when this fix will be in RHEL repository? It is already in upstream.
We are currently working on the patch inclusion to RHEL, but we are not able to reproduce this bug. Would you mind to share with us more detailed reproducer? The best would be to attach your httpd configuration.
Created attachment 1196615 [details]
HTTPd configuration files for this bug
I’m glad to hear some news from RH :D
Yes, when I said upstream I mean available in RH repositories.
Please find attached a redacted version of my HTTPd folder containing only relevant configuration files.
For information, Rémi COLLET, an active member of the #fedora IRC Chan do have the exact same problem.
I talked with him previously and he is the one who suggested me to fill for a bugzilla report.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.