From: stijn at win dot tue dot nl
Operating system: FreeBSD 4 and -CURRENT
PHP version: 4.3.10
PHP Bug Type: Apache2 related
Bug description: Cannot turn off PATH_INFO
Description:
------------
I'm trying to turn the support for PATH_INFO off on a *default* install of
apache-2.0.52 and php-4.3.10, but it doesn't work.
Note that I am not 100% sure that this is a PHP bug, however Apache does
not accept PATH_INFO for regular HTML files so I'm inclined to suspect
PHP.
I first installed Apache in a scratch directory:
./configure --prefix=/var/tmp/apachephp --enable-so --with-mpm=prefork
--enable-maintainer-mode
gmake
gmake install
Then PHP:
env CFLAGS=-g ./configure --prefix=/var/tmp/apachephp
--with-apxs2=/var/tmp/apachephp/bin/apxs --disable-cgi
--disable-path-info-check
gmake
gmake install
I edited /var/tmp/apachephp/conf/httpd.conf and added these lines:
%%%
AddType application/x-httpd-php .php
AcceptPathInfo off
<Directory /var/tmp/apachephp/htdocs>
AcceptPathInfo off
</Directory>
%%%
Adding a simple index.php to the docroot
(/var/tmp/apachephp/htdocs/index.php):
%%%
<? phpinfo(); ?>
%%%
After starting httpd, I can still browse to
http://localhost/index.php/foo/bar
and see that PATH_INFO indeed contains /foo/bar.
I've tried digging in the sources but I'm not familiar with Apache
plugins. I did see this in gdb:
%%%
Breakpoint 2, php_apache_request_ctor (r=0x81b2050, ctx=0x81b3e70)
at
/local/home/stijn/tmp/php-4.3.10/sapi/apache2handler/sapi_apache2.c:408
408 SG(sapi_headers).http_response_code = !r->status ? HTTP_OK
: r->status;
(gdb) print r->path_info
$1 = 0x81b3253 "/foo/bar"
(gdb) print r->used_path_info
$2 = 1
%%%
So in the request constructor the path info is already set up? I did see
something about overriding r->path_info for apache modules in the apache
sources but here is where I cannot follow the code anymore...
BTW, I tried to post this to php-general twice, but somehow my e-mail is
blocked. I do hope this is not PEBKAC but even if it is I would be glad if
someone pointed this out to me...
Reproduce code:
---------------
n/a
Expected result:
----------------
n/a
Actual result:
--------------
see above for a maybe relevant backtrace snippet
--
Edit bug report at http://bugs.php.net/?id=31717&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31717&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31717&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31717&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31717&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31717&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31717&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31717&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31717&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31717&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31717&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31717&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31717&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31717&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31717&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31717&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31717&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31717&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31717&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31717&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31717&r=mysqlcfg