Bug #60472 [Opn->Fbk]: PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER
Edit report at https://bugs.php.net/bug.php?id=60472&edit=1
ID: 60472
Updated by: laruence@php.net
Reported by: lolautruche at gmail dot com
Summary: PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER
-Status: Open
+Status: Feedback
Type: Bug
Package: Built-in web server
Operating System: Mac OS X 10.7.2 (Lion)
PHP Version: 5.4.0RC2
Block user comment: N
Private report: N
New Comment:
is the hello/world is actually a existing folder under you doc root? I think it's
no.
so actullay the built-in server will find the index.php under the doc_root, this
is a feature(for path_info), not a bug.
Previous Comments:
------------------------------------------------------------------------
[2011-12-08 16:11:51] lolautruche at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=60472&edit=1
Thread (4 messages)