From: florent at guiliani dot fr
Operating system: GNU/Linux Ubuntu
PHP version: 5.2.6
PHP Bug Type: PHP options/info functions
Bug description: FastCGI: option -C "chdir to the script's directory" doesn't
work
Description:
------------
The option -C "chdir to the script's directory" doesn't work when using
PHP as FASTCGI server.
Due to this issue a first request will work and a second identical request
will return "no input file specified"
Reproduce code:
---------------
$ strace -o strace.log /usr/bin/php5-cgi -C -b 9876
(run 2 identical requests)
$ grep "chdir\|index.php" strace.log
lstat64("/home/flgu/tmp/websvn/index.php", {st_mode=S_IFREG|0644,
st_size=1656, ...}) = 0
open("/home/flgu/tmp/websvn/index.php", O_RDONLY|O_LARGEFILE) = 7
chdir("/home/flgu/tmp/websvn") = 0
open("/home/flgu/tmp/websvn/websvn/index.php", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
$
Note the double "websvn/websvn" in the second open.
You can use this cgi to test it (adapt it with your own path):
#!/bin/bash
export SCRIPT_FILENAME=${REQUEST_URI/\/~flgu\/fast.cgi\//}
/home/flgu/tmp/fcgi-2.4.0/cgi-fcgi/cgi-fcgi -bind -connect localhost:9876
Expected result:
----------------
No chdir called and all request work
Actual result:
--------------
chdir called and only first request work
--
Edit bug report at http://bugs.php.net/?id=45125&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45125&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45125&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45125&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45125&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45125&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45125&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45125&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45125&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45125&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45125&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45125&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45125&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45125&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45125&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45125&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45125&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45125&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45125&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45125&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45125&r=mysqlcfg