php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80378 syntax error in php://input
Submitted: 2020-11-18 12:14 UTC Modified: 2020-11-20 16:01 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: 306503207 at qq dot com Assigned:
Status: No Feedback Package: FPM related
PHP Version: 7.2.34 OS: CentOS Linux release 7.4.1708
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-11-18 12:14 UTC] 306503207 at qq dot com
Description:
------------
FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected ']' in php://input on line 5" while reading response header from upstream

PHP Parse error:  syntax error, unexpected '{' in php://input on line 3" while reading response header from upstream


PHP Parse error:  syntax error, unexpected '{' in php://input on line 3" while reading response header from upstream



Suddenly, this problem appears. After restarting php-fpm, the problem disappears. After a while, the problem reappears.

The problem occurred in PHP-7.0.16. I update to PHP-7.0.33, but problems still arise.



Test script:
---------------
nginx + php-fpm


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-18 12:16 UTC] daverandom@php.net
-Status: Open +Status: Feedback
 [2020-11-18 12:16 UTC] daverandom@php.net
Please clarify which PHP version you are using. Note that the 7.0.x branch is no longer supported.
 [2020-11-18 12:31 UTC] 306503207 at qq dot com
The higher version may have the same problem. Has this bug been fixed?
 [2020-11-18 12:37 UTC] daverandom@php.net
Impossible to say because there is not enough information here to diagnose the problem. It could be an issue with opcache, in which case it is likely that an upgrade would fix the issue, yes.

Please note that PHP 8 is nearing release, and 7.0 has been unsupported for a long time. You really need to update PHP to a supported version as soon as possible, regardless of the issue you are currently experiencing.
 [2020-11-18 12:47 UTC] 306503207 at qq dot com
Thanks
 [2020-11-20 16:01 UTC] daverandom@php.net
-Status: Feedback +Status: No Feedback
 [2021-04-28 13:36 UTC] ahirsch29 at gmail dot com
I got the same Problem.

When posting Data to a url i Get the follwoing error:
Parse error:  syntax error, unexpected identifier "version" in php://input on line 1

My XML as an example looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<cXML>
</cXML>

I am only reading the content with
$post = file_get_contents('php://input‘);

It looks like it's trying to parse it.

"Suddenly, this problem appears. After restarting php-fpm, the problem disappears. After a while, the problem reappears." - I can confirm this. After killing the container the problem is gone for a while.

My setup:
Azure Kubernetes Cluster
Apache 2.4 (Alpine)
PHP-FPM 8.0.3 (Alpine)
 [2021-04-28 13:39 UTC] ahirsch29 at gmail dot com
As an additional information:
i put a die(); into the first line to the script I am sending the post - even then the Error Mesage is shown in Postman.

I am also using opcache but also did a opcache_reset(); before the die(); - But without any canges.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC