|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-02 14:35 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
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