|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68006 PHP-FPM strips headers
Submitted: 2014-09-11 12:42 UTC Modified: 2015-01-08 23:26 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 2 (0.0%)
From: aneganov at gmail dot com Assigned:
Status: Not a bug Package: FPM related
PHP Version: Irrelevant OS: Ubuntu 12.04
Private report: No CVE-ID: None
 [2014-09-11 12:42 UTC] aneganov at gmail dot com
Whatever header I added via apache config it is stripped by PHP-FPM.
Example headers why are stripped: 
Content-Type's charset
 - all of them are stripped from the output.

I didn't find any configuration or something which allows to change this.

I use PHP-FPM with Apache 2.2 and mod_fastcgi.

This make it impossible to use AddDefaultCharset in apache confs for example.

Expected result:
Trasparent passing the headers to the user

Actual result:
Custom headers are stripped


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 21:43 UTC]
-Status: Open +Status: Feedback
 [2015-01-08 21:43 UTC]

can you provide some more information about this issue as it's not clear what issue you are seeing. In CGI, after PHP processes the request, the response and the headers are passed to Apache, which then serves them to the user.

If you've configured Apache to add some headers to the response, then it wouldn't be possible for PHP to 'strip' them from the response.

Also please say which version of PHP are you using, and some example config for Apache that shows this issue.
 [2015-01-08 23:22 UTC] aneganov at gmail dot com
-Status: Feedback +Status: Open
 [2015-01-08 23:22 UTC] aneganov at gmail dot com
PHP 5.3.10-1ubuntu3.15 with Suhosin-Patch (cli) (built: Oct 29 2014 12:19:04) 

But as you said, it's not PHP-FPM fault, this issue should be closed and probably a follow-up opened for underlying "libapache2-mod-fastcgi", but IIRIC it's not actively maintained.

After I upgraded from Apache 2.2 to Apache 2.4 and replaced "libapache2-mod-fastcgi" with "mod-proxy", and started adding headers by hand in LUA hooks, it started working.
 [2015-01-08 23:26 UTC]
-Status: Open +Status: Not a bug
 [2015-01-08 23:26 UTC]
Closing as "not a bug", by request.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 10:03:39 2023 UTC