From: richard at hyperlink dot net dot nz Operating system: Linux Debian Etch PHP version: 5.2.1 PHP Bug Type: CGI related Bug description: 404 http status always occurs when using fastcgi and doc_root config directive
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 bug report at http://bugs.php.net/?id=41197&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41197&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41197&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41197&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41197&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41197&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41197&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41197&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41197&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41197&r=support Expected behavior: http://bugs.php.net/fix.php?id=41197&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41197&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41197&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41197&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41197&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41197&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41197&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41197&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41197&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41197&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41197&r=mysqlcfg