php.net |  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
Votes:1
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
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.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-26 09:04 UTC] tony2001@php.net
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


 [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: Sun Dec 22 10:01:28 2024 UTC