Bug #60472 [NEW]: PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER
| From: | lolautruche at gmail dot com | Date: | Thu, 08 Dec 2011 16:11:51 +0000 |
| Subject: | Bug #60472 [NEW]: PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-165742@lists.php.net to get a copy of this message | ||
From:
Operating system: Mac OS X 10.7.2 (Lion)
PHP version: 5.4.0RC2
Package: Built-in web server
Bug Type: Bug
Bug description:PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER
Description:
------------
By design, if no PHP script is present in the REQUEST_URI, built-in server
considers using a directory index (index.php or index.html). However,
PHP_SELF
and SCRIPT_NAME server variables are not correctly filled.
For instance, if I test http://localhost:8000/hello/world, SCRIPT_NAME will
be
"/index.php" and PHP_SELF will be "/index.php/hello/world", while on Apache
httpd, SCRIPT_NAME and PHP_SELF will be "/hello/world/index.php".
Test script:
---------------
php -S localhost:8000 router.php
router.php script :
<?php
var_dump( $_SERVER );
?>
Expected result:
----------------
Directory index should be AFTER the dir path :
"/hello/world/index.php"
Actual result:
--------------
Directory index is before the dir path :
"/index.php/hello/world"
--
Edit bug report at https://bugs.php.net/bug.php?id=60472&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60472&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60472&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60472&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60472&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60472&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60472&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60472&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60472&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60472&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60472&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60472&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60472&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60472&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60472&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60472&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60472&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60472&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60472&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60472&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60472&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60472&r=mysqlcfg