Bug #68236 [Opn->Fbk]: built-in server relative paths fail
| From: | requinix@php.net | Date: | Wed, 15 Oct 2014 17:33:22 +0000 |
| Subject: | Bug #68236 [Opn->Fbk]: built-in server relative paths fail | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188122@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68236&edit=1
ID: 68236
Updated by: requinix@php.net
Reported by: ibt dot zee at gmail dot com
Summary: built-in server relative paths fail
-Status: Open
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Windows XP/7/8/10
PHP Version: 5.6.1
Block user comment: N
Private report: N
New Comment:
The server does not resolve relative paths - the browser does. If you put output and click a link to
"../index.html" then the server will receive a request for /index.html.
What is the exact <a href> in question?
Previous Comments:
------------------------------------------------------------------------
[2014-10-15 16:42:36] ibt dot zee at gmail dot com
Description:
------------
Using php built-in server : php.exe -S 127.0.0.1 -t c:\myWebRoot
if a relative path is used in a sub-folder the server assume the root as beeing that folder (the
assumed root should always be the root indicated in the command line, in this case was c:\myWebRoot,
this would prevent this strange fails)
took me quite a while to understand why my sites worked ok in IIS, LAMP, WAMP, any Apache server...
but failed using php built-in server...
As this built-in server is a excelent and useful resource,
I urge you to solve this odd behaviour... for versions 5.4.x and 5.6.x
Test script:
---------------
no script,
this will happen even with a simple HTML static page link <a> from any subfolder
as you click the link (if it has a relative path, for example other html file in the same folder)
php-server try to find it in root...
wwwroot
index.html
images_folder
any_image.png
pages_folder
page1.html
page2.html
if you have a link <a> in page1.html that is inside pages_folder
and that link jumps to page2.html
php built-in server will fail to retrive page2.html because is looking for
/page2.html instead of ./page2.html
the problem is that assume the current folder as root to search for relative links
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68236&edit=1