#41197 [Opn->Fbk]: 404 http status always occurs when using fastcgi and doc_root config directive
| From: | tony2001@php.net | Date: | Thu, 26 Apr 2007 09:04:20 +0000 |
| Subject: | #41197 [Opn->Fbk]: 404 http status always occurs when using fastcgi and doc_root config directive | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111922@lists.php.net to get a copy of this message | ||
ID: 41197
Updated by: tony2001@php.net
Reported By: richard at hyperlink dot net dot nz
-Status: Open
+Status: Feedback
Bug Type: CGI related
Operating System: Linux Debian Etch
PHP Version: 5.2.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2007-04-26 05:28:09] richard at hyperlink dot net dot nz
Description:
------------
I have php running as a fastcgi in a chroot jail.
The path to document root in the jail is different from the path
outside the jail so I've used the 'doc_root' directive in php.ini so
that php can find the php script.
PHP finds and runs the php script fine but always returns a status
coded of 404 not found.
I've done an strace and verified the problem occurs in
php(5.2.0-8+etch1) not mod_fastcgi or apache.
Sorry I haven't downloaded a later version, company policy is to only
use prebuilt stable packages :-(. I've verified the bug in 5.2.0.
Looking at http://lxr.php.net/source/php-src/sapi/cgi/cgi_main.c
/*
$Id: cgi_main.c,v 1.320 2007/04/17 20:01:22 sniper Exp $ */ it looks
like the problem may be:
line 867: if (!ptr) {
...
line 887: SG(sapi_headers).http_response_code = 404;
The preceeding 100 or so lines do some pretty knarly stuff changing ptr
and scanning through possible strings of SCRIPT_PATH_TRANSLATED.
Workaround is:
header("HTTP/1.0 200");
in php prepend file.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41197&edit=1