Bug #75647 [NEW]: `-t dir` changed behavior when combined with a router file

From: Date: Thu, 07 Dec 2017 15:09:03 +0000
Subject: Bug #75647 [NEW]: `-t dir` changed behavior when combined with a router file
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212995@lists.php.net to get a copy of this message
From: martin dot st at wolke7 dot net Operating system: Linux PHP version: 7.1.12 Package: Built-in web server Bug Type: Bug Bug description:-t dir changed behavior when combined with a router file Description: ------------ This is my first bug report to PHP, so please don't be mad at me. The following command used to work fine but stopped working in PHP 7.1.12 php -S localhost:8000 -t directory directory/router.php It seems like somebody changed the way relative paths are handled when using the -t option and a router file at the same time. This statement also shows how this was working 3 months ago: http://php.net/manual/en/features.commandline.webserver.php#121501 I think it might be related to the following commit, but I'm not very sure (I'm not a C developer): http://git.php.net/?p=php-src.git;a=commit;h=816758eda2bcdd69ba505fb6bbb79124a7bf2254 What actually happens --------------------- Starting the server works nicely: $ php -S localhost:8000 -t directory directory/router.php PHP 7.1.12 Development Server started at Thu Dec 7 15:00:15 2017 Listening on http://localhost:8000 Document root is [/home/myuser/mycode/directory] Press Ctrl-C to quit. When a request comes in, I get a message like the following (both in the result and in the server output): [Thu Dec 7 15:00:21 2017] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 [Thu Dec 7 15:00:21 2017] PHP Fatal error: Unknown: Failed opening required '/home/myuser/mycode/directory/directory/router.php' (include_path='.:/home/rof/.phpenv/versions/7.1.12/lib/php/pear') in Unknown on line 0 -- Edit bug report at https://bugs.php.net/bug.php?id=75647&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75647&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75647&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75647&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75647&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75647&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75647&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75647&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75647&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75647&r=support Expected behavior: https://bugs.php.net/fix.php?id=75647&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75647&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75647&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75647&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75647&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75647&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75647&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75647&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75647&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75647&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75647&r=mysqlcfg

« previous php.bugs (#212995) next »