php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75120 php fpm returns http status 200 Ok and blank page if script no exist
Submitted: 2017-08-25 14:41 UTC Modified: 2020-11-28 21:40 UTC
Votes:11
Avg. Score:4.8 ± 0.4
Reproduced:11 of 11 (100.0%)
Same Version:3 (27.3%)
Same OS:3 (27.3%)
From: peter dot volkov at gmail dot com Assigned: bukka (profile)
Status: Duplicate Package: FPM related
PHP Version: 5.6.31 OS: Gentoo Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: peter dot volkov at gmail dot com
New email:
PHP Version: OS:

 

 [2017-08-25 14:41 UTC] peter dot volkov at gmail dot com
Description:
------------
If we call php-fpm with SCRIPT_FILENAME=/some.php it will return http status 200 and blank page. At the same time php-fpm's access.log will contain:

24/Aug/2017:21:51:33 +0300 "- " 200 - 3.682 256 0.00% GET

I expect to receive some error message instead.

It looks like this is rather known problem and since error message is not very evident it may take days to debug it! It's easy to step on this problem since default nginx configuration sometime has:

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;

instead of:

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

And now consider this two cases! In second case if I request notexisting script I'll receive status 404 with "File not found." in the body. And in the first case:

< HTTP/1.1 200 OK
< Server: nginx
< Date: Thu, 24 Aug 2017 18:51:33 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Keep-Alive: timeout=20
< X-Powered-By: PHP/5.6.30-pl0-gentoo
< 
* Connection #0 to host rc.online.telekarta.tv left intact

Status 200 and no body. Why do we have this difference?

And I'm not alone with this problem: http://beutelevision.com/blog2/2013/08/26/nginx-with-php-fpm-generating-blank-page/ and in other places of the internet. 

What is the reason for this behaviour? Can we have this fixed?

Test script:
---------------
No script required.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-30 07:52 UTC] mr dot felixoid at gmail dot com
Here is PR for this problem https://github.com/php/php-src/pull/3227
 [2020-11-28 21:40 UTC] bukka@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: bukka
 [2020-11-28 21:40 UTC] bukka@php.net
This is duplicate of https://bugs.php.net/bug.php?id=69625 - the PR for that is here: https://github.com/php/php-src/pull/6466
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC