Bug #68236 [Fbk->NoF]: built-in server relative paths fail
Edit report at https://bugs.php.net/bug.php?id=68236&edit=1
ID: 68236
Updated by: php-bugs@lists.php.net
Reported by: ibt dot zee at gmail dot com
Summary: built-in server relative paths fail
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: *General Issues
Operating System: Windows XP/7/8/10
PHP Version: 5.6.1
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2014-10-15 17:33:22] requinix@php.net
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?
------------------------------------------------------------------------
[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
Thread (3 messages)