php.net |  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
Votes:3
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aneganov at gmail dot com
New email:
PHP Version: OS:

 

 [2014-09-11 12:42 UTC] aneganov at gmail dot com
Description:
------------
Whatever header I added via apache config it is stripped by PHP-FPM.
Example headers why are stripped: 
Content-Type's charset
X-Frame-Option
Access-Control-Allow-Origin
 - 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-08 21:43 UTC] danack@php.net
-Status: Open +Status: Feedback
 [2015-01-08 21:43 UTC] danack@php.net
Hi, 

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] salathe@php.net
-Status: Open +Status: Not a bug
 [2015-01-08 23:26 UTC] salathe@php.net
Closing as "not a bug", by request.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC