|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81000 syntax error in php://input
Submitted: 2021-04-29 08:34 UTC Modified: 2021-04-29 08:39 UTC
From: ahirsch29 at gmail dot com Assigned:
Status: Duplicate Package: FPM related
PHP Version: 8.0.3 OS: Alpine Linux v3.13.5
Private report: No CVE-ID: None
 [2021-04-29 08:34 UTC] ahirsch29 at gmail dot com
FastCGI sent in stderr: "Parse error: syntax error, unexpected identifier "version" in php://input on line 1" when sending POST with the following POST-Data:
<?xml version="1.0" encoding="UTF-8"?>

If I am sending the following data to the script:
<?php echo 3 + 3; ?>

I am getting this result:

Somehow the XML get's interpreted without any logic within the script that is called.

Rebooting the docker container (8.0.3-fpm-alpine3.13) will solve the problem for a while - but after a couple hours the problem appears again.

Currently OpCache is enabled - also tryed to disable it.

Log does not show anything special: - 29/Apr/2021:08:26:58 +0000 "POST /index.php" 200

Even if i place invalid code into the index.php:

I am getting this result:
<test>test</test><br />
<b>Fatal error</b>:  Uncaught Error: Call to undefined function thisShouldNotWork() in /app/source/index.php:2
Stack trace:
#0 {main}
  thrown in <b>/app/source/index.php</b> on line <b>2</b><br />

But the log shows a successful POST - even a excaption was thrown: - 29/Apr/2021:08:29:28 +0000 "POST /index.php" 200

There might be a related bug for 7.x:

Test script:
The script (index.php) contains nothing but a die();:

There is no logic at all within this script so I am asuming this error somewhere else.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-29 08:35 UTC] ahirsch29 at gmail dot com
-Package: *General Issues +Package: FPM related
 [2021-04-29 08:35 UTC] ahirsch29 at gmail dot com
changed Package
 [2021-04-29 08:39 UTC]
-Status: Open +Status: Duplicate
 [2021-04-29 08:39 UTC]
Sounds like bug #80385.
 [2021-04-29 09:57 UTC] ahirsch29 at gmail dot com
For giving more insights into the infra structure:
The application is hosted within AKS and there are two containers:
1) httpd:2.4.46-alpine
directs to php-fpm via Proxy:
<VirtualHost *:80>
  ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://ottofischer-<environment>-php-fpm:9000/app/source/$1
  DirectoryIndex /index.php index.php
  DocumentRoot "/app/source"
  RequestHeader set X-Forwarded-server https
  <Directory "/app/source">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    DirectoryIndex index.php

2) php8.0.3-alpine3.13
All configs are standard / using php.ini-production as php.ini.

listen =

Port 9000 is published internally, but not externally:
apiVersion: v1
kind: Service
  name: {{ .Chart.Name }}-php-fpm
    app: {{ .Chart.Name }}-php-fpm
      - name: php-fpm
        protocol: TCP
        port: 9000
        targetPort: 9000
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 21:01:31 2024 UTC