Your Location is: Home > Php

Where could PHP output which started at php://input:1 be originating from?

From: Honiara View: 4724 Ke Vin 

Question

Today I tried to login to my wordpress instance which is running on my own server. Upon clicking Login, the page reported the following:

log=admin&pwd=passwort&wp-submit=Log+In&redirect_to=https%3A%2F%2Fwww.mydomain.com%2Fwp-admin%2F&testcookie=1
Warning: Cannot modify header information - headers already sent by (output started at php://input:1) in /var/www/html/wp-login.php on line 504

Warning: Cannot modify header information - headers already sent by (output started at php://input:1) in /var/www/html/wp-login.php on line 520

Warning: Cannot modify header information - headers already sent by (output started at php://input:1) in /var/www/html/wp-includes/functions.php on line 6225

My setup is as follows:

  • PHP 7.0.15
  • Wordpress 4.7.1
  • Nginx, MySql and Wordpress running as docker instances
  • Another nginx instance that coordinates the routing and redirections (e.g. http -> https)
        Name                      Command              State            Ports
--------------------------------------------------------------------------------------
wordpress_mysql_1       docker-entrypoint.sh mysqld    Up      0.0.0.0:3306->3306/tcp
wordpress_nginx_1       nginx -g daemon off;           Up      127.0.0.1:44654->80/tcp
wordpress_wordpress_1   docker-entrypoint.sh php-fpm   Up      0.0.0.0:9000->9000/tcp

The thing that bothers me is the source of the output: php://input:1. I tried adding a die('test'); right after the <php opening tag in wp-login.php and to my surprise, the string 'test' appeared AFTER the request string.

Does someone have an idea how I could debug this or where this could possibly be coming from?

Best answer

For some reason, auto_prepend_file was set to php://input although the default value should be NULL. I could not find where exactly this value was altered but adding auto_prepend_file=NULL to php.ini and restarting the instances fixed this issue.