https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412012-11-19T14:41:44Zlighty labsLighttpd - Bug #2460: (mod_cgi.c.1041) chdir failed: no such file or directory index.php https://redmine.lighttpd.net/issues/2460?journal_id=79892012-11-19T14:41:44Zstbuehler
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Need Feedback</i></li></ul><p>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 "/").</p>
<p>Try</p>
<pre>
debug.log_request_handling = "enabled"
</pre>
<p>and check <a class="wiki-page" href="https://redmine.lighttpd.net/projects/lighttpd/wiki/DebugVariables">DebugVariables</a></p> Lighttpd - Bug #2460: (mod_cgi.c.1041) chdir failed: no such file or directory index.php https://redmine.lighttpd.net/issues/2460?journal_id=87322016-02-12T04:36:40Zgstrauss
<ul></ul><p>The attached lighttpd.conf contains<br /><pre>
var.server_root = "/"
</pre><br />and later<br /><pre>
server.document-root = server_root
</pre><br />(This makes more sense if I also mention that the attached lighttpd.conf contains:<br /><pre>
server.chroot = "/usr/local/apache2/webdav/usrfolder/"
</pre></p>
<p>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)</p>
<p>Created pull request <a class="external" href="https://github.com/lighttpd/lighttpd1.4/pull/18">https://github.com/lighttpd/lighttpd1.4/pull/18</a> with fix.</p>
<p>As an aside, while not the issue in this ticket, the chroot setting appears to conflict with<br /><pre>
server.upload-dirs = ( "/usr/local/apache2/webdav/usrfolder/tmp" )
</pre><br />Within the chroot, server.upload-dirs should probably be<br /><pre>
server.upload-dirs = ( "/tmp" )
</pre></p> Lighttpd - Bug #2460: (mod_cgi.c.1041) chdir failed: no such file or directory index.php https://redmine.lighttpd.net/issues/2460?journal_id=87812016-02-14T10:55:04Zstbuehler
<ul><li><strong>Status</strong> changed from <i>Need Feedback</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r3077.</p> Lighttpd - Bug #2460: (mod_cgi.c.1041) chdir failed: no such file or directory index.php https://redmine.lighttpd.net/issues/2460?journal_id=87832016-02-14T11:09:17Zstbuehler
<ul><li><strong>Target version</strong> set to <i>1.4.40</i></li></ul>