Edit report at https://bugs.php.net/bug.php?id=60472&edit=1
ID: 60472 Updated by: larue...@php.net Reported by: lolautruche at gmail dot com Summary: PHP_SELF/SCRIPT_NAME wrongly defined in $_SERVER -Status: Feedback +Status: Bogus 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: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php this is not a bug, but a feature. thanks Previous Comments: ------------------------------------------------------------------------ [2011-12-09 10:26:36] lolautruche at gmail dot com Hi Indeed, it's a virtual folder. I was comparing built-in server behaviour with Apache HTTPD's. So I guess you'd suggest to alter those server variables in the router script ? Thanks ------------------------------------------------------------------------ [2011-12-09 02:43:50] larue...@php.net 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. ------------------------------------------------------------------------ [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