Edit report at https://bugs.php.net/bug.php?id=80385&edit=1
ID: 80385
Updated by: requinix@php.net
Reported by: 306503207 at qq dot com
Summary: Response data preceded by post data
Status: Open
Type: Bug
Package: FPM related
Operating System: CentOS 7.4
PHP Version: 7.2.34
Block user comment: N
Private report: N
New Comment:
Right, by "page" I meant the different refreshes of the page in the browser.
If the auto_prepend_file is different then maybe other things are different. Compare the phpinfo
outputs.
Previous Comments:
------------------------------------------------------------------------
[2020-11-22 23:13:26] shoebox at dnbradio dot com
Well I would agree with you that this is highly unlikely, but these are not 2 different php pages.
It is a single php page that I am refreshing and you can watch the value change from
"none" to "php://input" just by refreshing the page.
There is nothing special about the configuration. It is a base install of php-fpm running on a
docker container with nginx setup as a standard reverse proxy. I have even tried using
ini_set("auto_prepend_file","none"); at the top of my script but the phpinfo()
output shows auto_prepend_file changing on its own.
------------------------------------------------------------------------
[2020-11-22 22:18:11] requinix@php.net
I find it highly unlikely that PHP itself is randomly deciding to set auto_prepend_file to
php://input.
Compare the phpinfo outputs from the two different pages - are they perhaps using different php-fpm
pools or configurations?
------------------------------------------------------------------------
[2020-11-22 21:32:28] shoebox at dnbradio dot com
I thought perhaps this was caused by a misconfiguration but I found that even if I explicitly set
auto_prepend_file = none, the problem persists.
I have tested by creating a php script <?php phpinfo(); ?> and when I refresh the page over
and over I see the auto_prepend_file setting keeps changing back and forth from none to php://input
Here is a screen cap demonstrating the problem: https://www.dropbox.com/s/2kofxya97gmydpi/Nov-22-2020%2014-17-58.mp4?dl=0
------------------------------------------------------------------------
[2020-11-21 18:59:49] shoebox at dnbradio dot com
I can confirm the same issue is happening with my PHP-FPM instance. I have tested all the way up to
7.4 and the problem persists.
Steps to reproduce.
1. Create script called /test.php with code <?php echo "foo"; ?>
2. Make a POST request with post params bar=1 via x-www-form-urlencoded or raw to a PHP endpoint
over http.
Expected Result:
Response body should be "foo"
Actual Result:
Response body includes post params prepended to the HTTP response.
i.e. "bar=1test"
------------------------------------------------------------------------
[2020-11-21 09:33:24] 306503207 at qq dot com
When this happens, rockmongo installed on the same machine has the same problem. After restarting
PHP FPM, the response is correct. I met some people in a discussion group. Have you ever recorded
such a bug.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80385
--
Edit this bug report at https://bugs.php.net/bug.php?id=80385&edit=1