php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69850 fpm don't receive a script name
Submitted: 2015-06-16 16:16 UTC Modified: 2015-07-01 20:30 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: pascal007 at gmx dot ch Assigned:
Status: Closed Package: FPM related
PHP Version: 7.0.0alpha1 OS: Debian 7.8
Private report: No CVE-ID: None
 [2015-06-16 16:16 UTC] pascal007 at gmx dot ch
Description:
------------
When I use php-fpm together with the PHP7 alpha1 on an nginx server I get a 502 Bad Gateway from nginx.

In the nginx log I see this error:

[error] 1889#0: *4 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.20, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php70-fpm.sock:", host: "xxx.xxx.xxx.21"

If I look into the log of the php-fpm service I see this:

WARNING: pid 2582, fpm_request_check_timed_out(), line 277: [pool www0] child 2813, script '' (request: " ") execution timed out (120.018160 sec), terminating

If I run the same configuration with PHP 5.5.x and 5.6.x everything works fine. Just with the 7.0 alpha 1 this problem happens. PHP 7 command line SAPI works fine.

Test script:
---------------
Nginx fastcgi_params I use:

fastcgi_param   QUERY_STRING            $query_string;
fastcgi_param   REQUEST_METHOD          $request_method;
fastcgi_param   CONTENT_TYPE            $content_type;
fastcgi_param   CONTENT_LENGTH          $content_length;

fastcgi_param   SCRIPT_FILENAME         $document_root$fastcgi_script_name;
fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
fastcgi_param   PATH_INFO               $fastcgi_script_name;
fastcgi_param   REQUEST_URI             $request_uri;
fastcgi_param   DOCUMENT_URI            $document_uri;
fastcgi_param   DOCUMENT_ROOT           $document_root;
fastcgi_param   SERVER_PROTOCOL         $server_protocol;

fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

fastcgi_param   REMOTE_ADDR             $remote_addr;
fastcgi_param   REMOTE_PORT             $remote_port;
fastcgi_param   SERVER_ADDR             $server_addr;
fastcgi_param   SERVER_PORT             $server_port;
fastcgi_param   SERVER_NAME             $server_name;

fastcgi_param   HTTPS                   $https;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param   REDIRECT_STATUS         200;

Expected result:
----------------
php-fpm should get a script name to execute.

Actual result:
--------------
php-fpm does not get a script name to execute and times out.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-17 02:38 UTC] laruence@php.net
what about slow-log? maybe have a try with it?
 [2015-06-17 07:14 UTC] pascal007 at gmx dot ch
The slow log stays empty with:

request_slowlog_timeout = 5s
slowlog = /var/log/$pool.log.slow
 [2015-06-20 08:30 UTC] pascal007 at gmx dot ch
Seems to be related to this one: https://bugs.php.net/bug.php?id=69875
 [2015-06-23 04:44 UTC] kyra at existing dot me
I'm also experiencing the same issue with PHP7. I loaded a single pool and made a single PHP request to a file with nothing but phpinfo() and the request works. 

However, my error log then begins to fill up. The interesting part is that it maxes out the children of 25, which such a request should not do.

Here is a copy of my php-fpm.log
 - http://pastebin.com/raw.php?i=J2EHcMgs
 [2015-06-23 12:47 UTC] remi@php.net
I confirm
PHP 5.6.10 works
PHP 7.0.0-dev (Jun 17 2015)
- network socket: OK.
- UDS: broken
 [2015-06-23 21:58 UTC] pascal007 at gmx dot ch
On alpha1 network socket also fails. Don't know if this got fixed with the latest commits (June 17th). But when I use 127.0.0.1:9001 instead of unix sockets I end up with:

fpm log

[23-Jun-2015 23:47:10] WARNING: [pool www0] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 19 total children
[23-Jun-2015 23:47:11] WARNING: [pool www0] server reached pm.max_children setting (20), consider raising it
[23-Jun-2015 23:48:17] WARNING: [pool www0] child 15323 exited on signal 11 (SIGSEGV) after 75.847845 seconds from start
[23-Jun-2015 23:48:17] NOTICE: [pool www0] child 15437 started

nginx log

[error] 15418#0: *430 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.20, server: _, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "x.x.x.21", referrer: "http://x.x.x.21/info.php"
 [2015-06-24 19:53 UTC] pascal007 at gmx dot ch
It's magically fixed in alpha2.
 [2015-07-01 11:51 UTC] tyrael@php.net
-Status: Open +Status: Feedback
 [2015-07-01 11:51 UTC] tyrael@php.net
so is this fixed with alpha2?
 [2015-07-01 20:29 UTC] pascal007 at gmx dot ch
-Status: Feedback +Status: Open
 [2015-07-01 20:29 UTC] pascal007 at gmx dot ch
For me it works fine since I compiled and installed alpha2. So for me this bug is fixed.
 [2015-07-01 20:30 UTC] pascal007 at gmx dot ch
-Status: Open +Status: Closed
 [2015-07-01 20:30 UTC] pascal007 at gmx dot ch
For me it works fine since I compiled and installed alpha2. So for me this bug is fixed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 14:01:31 2024 UTC