From:             ceefour at gauldong dot net
Operating system: Linux, Apache 1.3.33
PHP version:      4.3.10
PHP Bug Type:     CGI related
Bug description:  PHP_SELF incorrect without cgi.fix_pathinfo, but turning on 
screws up PATH_INFO

Description:
------------
Following up bug #31843, I tried to set cgi.fix_pathinfo On, which is
"weird" considering that this option says ANYthing about PHP_SELF. But a
good friend of mine pointed out it works on fixing PHP_SELF, so I did, and
to my surprise, it works!

So, my problem was solved, PHP_SELF was returning the correct value...
though not in a very elegant way, in my opinion, since who has access to
some hosting server's php.ini? Everyone but the most elite premium
services, I guess. Nonetheless it worked, so I enjoyed cherish, fortune,
and glory... for several seconds.

It turned that turning on cgi.fix_pathinfo actually screws up PATH_INFO,
at least in my configuration, which is VERY strange considering the name
of the option (shouldn't it be cgi.fix_phpself_and_screw_up_pathinfo???)
;-)

Let me apologize for a bit of sinism but really it was just for making fun
out of it. So, phpinfo() says PATH_INFO and PATH_TRANSLATED is now "no
value". Something's good though, ORIG_PATH_* returns the correct value
(weird). It's possible to use ORIG_PATH_* but I guess I should stick to
the standards. Since that server was in heavy use, I quickly realized that
by just turning that option on, I could have caused many pages to fail
(since they rely on PATH_INFO) so I quickly turn this option off again (I
already had a workaround for PHP_SELF bug, it's not a problem anymore but
I'm still seeking for an elegant resolution on this, in the part of PHP
developers not in my part).

Reproduce code:
---------------
phpinfo()

Expected result:
----------------
PHP_SELF: phpinfo.php/test/me
PATH_INFO: /test/me

Actual result:
--------------
cgi.fix_path_info=Off:

PHP_SELF: /test/me
PATH_INFO: /test/me

cgi.fix_path_info=On:

PHP_SELF: phpinfo.php/test/me
PATH_INFO: (no value)


-- 
Edit bug report at http://bugs.php.net/?id=31892&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31892&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31892&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31892&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31892&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31892&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31892&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31892&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31892&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31892&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31892&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31892&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31892&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31892&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31892&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31892&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31892&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31892&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31892&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31892&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31892&r=mysqlcfg

Reply via email to