Bug #74205 [NEW]: PATH_INFO partially support

From: Date: Sat, 04 Mar 2017 17:09:21 +0000
Subject: Bug #74205 [NEW]: PATH_INFO partially support
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207686@lists.php.net to get a copy of this message
From:             remi
Operating system: irrevelant
PHP version:      Next Minor Version
Package:          Built-in web server
Bug Type:         Bug
Bug description:PATH_INFO partially support

Description:
------------
According to documentation
http://php.net/manual/en/features.commandline.webserver.php

"URI requests are served from the current working directory where PHP
was started, unless the -t option is used to specify an explicit
document root. If a URI request does not specify a file, then either
index.php or index.html in the given directory are returned. If neither
file exists, the lookup for index.php and index.html will be continued
in the parent directory and so on until one is found or the document
root has been reached. If an index.php or index.html is found, it is
returned and $_SERVER['PATH_INFO'] is set to the trailing part of the
URI. Otherwise a 404 response code is returned."

So we can understand this as the apache rewirte equiv to

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

But as soon as the URI contain a dot, this doesn't work.

Also see
http://discourse.slimframework.com/t/path-issue-404-on-some-routes-using-php-builtin-webserver/1193


Test script:
---------------
With a tree containif only a index.php

wget  -q http://localhost:8888/foo/bar
wget  -q http://localhost:8888/foo-1.1/bar
wget  -q http://localhost:8888/foo/bar.png


Expected result:
----------------
PHP 7.2.0-dev Development Server started at Sat Mar  4 18:07:49 2017
Listening on http://localhost:8888
Document root is /work/build/phpmaster
Press Ctrl-C to quit.
[Sat Mar  4 17:56:34 2017] 127.0.0.1:39094 [200]: /foo/bar
[Sat Mar  4 17:56:42 2017] 127.0.0.1:39096 [200]: /foo-1.1/bar
[Sat Mar  4 17:56:46 2017] 127.0.0.1:39104 [200]: /foo/bar.png


Actual result:
--------------
PHP 7.2.0-dev Development Server started at Sat Mar  4 18:07:49 2017
Listening on http://localhost:8888
Document root is /work/build/phpmaster
Press Ctrl-C to quit.
[Sat Mar  4 18:07:53 2017] 127.0.0.1:39402 [200]: /foo/bar
[Sat Mar  4 18:07:57 2017] 127.0.0.1:39404 [404]: /foo-1.1/bar - No such
file or directory
[Sat Mar  4 18:08:01 2017] 127.0.0.1:39412 [404]: /foo/bar.png - No such
file or directory


-- 
Edit bug report at https://bugs.php.net/bug.php?id=74205&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=74205&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=74205&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=74205&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=74205&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=74205&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=74205&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=74205&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=74205&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=74205&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=74205&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=74205&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=74205&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=74205&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74205&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=74205&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=74205&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=74205&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74205&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=74205&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=74205&r=mysqlcfg



Thread (6 messages)

« previous php.bugs (#207686) next »