Bug #2460
closed(mod_cgi.c.1041) chdir failed: no such file or directory index.php
Description
I am using php with pdirl and am getting
(mod_cgi.c.1041) chdir failed: no such file or directory index.php
it appears to be trying to chdir into a file. This is on an embedded system.
pdirl can be found here.
http://pdirl.newroots.de/
Files
Updated by stbuehler about 12 years ago
- Status changed from New to Need Feedback
You mapped the request to the filename "index.php/$something"; I have no idea how you did that (usually all pathnames are absolute, i.e. should start with "/").
Try
debug.log_request_handling = "enabled"
and check DebugVariables
Updated by gstrauss almost 9 years ago
The attached lighttpd.conf contains
var.server_root = "/"
and later
server.document-root = server_root
(This makes more sense if I also mention that the attached lighttpd.conf contains:
server.chroot = "/usr/local/apache2/webdav/usrfolder/"
Therefore, the bug in mod_cgi is that it does c = strrchr(path, '/') and, in addition to checking if c is NULL, needs to check if c path. If c path, then chdir("/"), else temporarily set c = '\0' and chdir(path)
Created pull request https://github.com/lighttpd/lighttpd1.4/pull/18 with fix.
As an aside, while not the issue in this ticket, the chroot setting appears to conflict with
server.upload-dirs = ( "/usr/local/apache2/webdav/usrfolder/tmp" )
Within the chroot, server.upload-dirs should probably be
server.upload-dirs = ( "/tmp" )
Updated by stbuehler almost 9 years ago
- Status changed from Need Feedback to Fixed
- % Done changed from 0 to 100
Applied in changeset r3077.
Also available in: Atom