php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37240 doc_root causes CGI to fail with "No input file specified." error
Submitted: 2006-04-29 00:52 UTC Modified: 2006-06-30 22:03 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: phpbugs at thequod dot de Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4CVS-2006-04-29 (CVS) OS: Ubuntu Linux
Private report: No CVE-ID: None
 [2006-04-29 00:52 UTC] phpbugs at thequod dot de
Description:
------------
If doc_root gets enabled with PHP 4.4.3-dev (cgi) (built: 
Apr 29 2006 02:13:25) it causes an "No input file 
specified." error.

I've tried it with "--enable-discard-path", after first 
experiencing this error, but the result was the same as 
without this configure option.

It fails on URLs like 
http://demo.b2evolution.net/HEAD.4/blogs/index.php?blog=2 
(I've removed the doc_root option, so it won't fail there 
anymore), but strangely not on 
http://demo.b2evolution.net/phpinfo.4 !

The last (working) URL gets rewritten to /content.php4 
internally (.htaccess):
RewriteRule ^phpinfo(?:\.(4))?/?$ /content.php$2/$1 [L]

The first (non-working) URL gets not rewritten, but is 
a "plain" existing file.

NOTE: I'm using a chroot (with Apache's mod_chroot) and 
therefor also have a recursive symlink "/XXX" in the 
chroot "/XXX" itself - _maybe_ that could cause this.

The problem does not appear with 5.1.3-cvs.

Reproduce code:
---------------
doc_root set in php.ini to the same as DocumentRoot in Apache 2.

My configure:

./configure \
--prefix=/XXX/make/php4 \
--with-config-file-path=/etc/php4 \
--with-pear=/XXX/lib/php4 \
--enable-calendar \
--enable-exif \
--enable-fastcgi \
--enable-force-cgi-redirect  \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-mbstring \
--enable-memcache \
--enable-memory-limit \
--enable-sockets \
--enable-track-vars \
--with-bz2 \
--with-dom \
--with-freetype-dir \
--with-gd \
--with-gettext \
--with-iconv \
--with-jpeg-6b \
--with-jpeg-dir \
--with-ldap \
--with-ldap-sasl \
--with-mysql \
--with-openssl \
--with-png-dir \
--without-mm \
--without-sqlite \
--with-pcre-regex \
--with-ttf \
--with-zlib \
--with-zlib-dir=/bin


I've also tried --enable-discard-path (which is not recommened for fastcgi (in README.FastCGI), because of some hint in a "bogus" bug report, with the same result.


The problem is probably in "sapi/cgi/cgi_main.c". 
I'd like to help debug this, but would need a hint, where to start.


Expected result:
----------------
Page gets parsed by PHP.

Actual result:
--------------
"No input file specified." error gets thrown.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-29 01:34 UTC] phpbugs at thequod dot de
Correction: it also fails with PHP5.1.3-CVS, BUT only if 
the doc_root option is set to somewhere below Apache's 
DocumentRoot!

It does not fail for
doc_root = /var/www/host/public_html/
but
doc_root = /var/www/host/
 [2006-06-20 14:55 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-06-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-06-30 19:35 UTC] phpbugs at thequod dot de
Probably I've misunderstood the doc_root setting: I've 
thought it would specify where files may get accessed 
from, but instead it's the prefix for the requested 
URI/path.

Sorry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 18:01:34 2024 UTC