Bug #68236 [NEW]: built-in server relative paths fail
From: ibt dot zee at gmail dot com
Operating system: Windows XP/7/8/10
PHP version: 5.6.1
Package: *General Issues
Bug Type: Bug
Bug description:built-in server relative paths fail
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 bug report at https://bugs.php.net/bug.php?id=68236&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68236&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68236&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68236&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68236&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68236&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68236&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68236&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68236&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68236&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68236&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68236&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68236&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68236&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68236&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68236&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68236&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68236&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68236&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68236&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68236&r=mysqlcfg
Thread (3 messages)
- ibt dot zee at gmail dot com