|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41197 404 http status always occurs when using fastcgi and doc_root config directive
Submitted: 2007-04-26 05:28 UTC Modified: 2007-05-04 01:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: richard at hyperlink dot net dot nz Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.2.1 OS: Linux Debian Etch
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: richard at hyperlink dot net dot nz
New email:
PHP Version: OS:


 [2007-04-26 05:28 UTC] richard at hyperlink dot net dot nz
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 /* $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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-26 09:04 UTC]
Please try using this CVS snapshot:
For Windows:

 [2007-05-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-12-31 07:23 UTC] venkatasurya459 at gmail dot com
I FACE AN ERROR STATUS OF 404,i.e description:The requested resource 
(/assesTool/) is not available
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 22:01:32 2024 UTC