|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60496 PHP cli-server does not report syntax errors in the router
Submitted: 2011-12-12 01:13 UTC Modified: 2011-12-15 03:32 UTC
From: php at danielfriesen dot name Assigned:
Status: Duplicate Package: Built-in web server
PHP Version: 5.4.0RC3 OS: Mac OS X 10.7.2 (Lion)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: php at danielfriesen dot name
New email:
PHP Version: OS:


 [2011-12-12 01:13 UTC] php at danielfriesen dot name
Even when enabled in a router php's built-in webserver does not report any errors coming from the router or included scripts.

Note that it's currently necessary to do php execution from a router using a require instead of by using `return false;` because of virtual paths where a "/fake-nonexistent-path" may be desired to be routed to "/somescript.php" instead of attempting to serve the file "fake-nonexistent-path" in the docroot. The api does not seem to have a way to `return false;` telling the server to serve a completely different file so the only way to have this behavior is to use a require call.

Obviously it would also be nice for errors to be reported simply so that you can fix bugs in the router itself as well.

Test script:
# ./router.php

ini_set('display_errors', 1);

require_once( "./a.php" );

# ./a.php

this is a syntax error;

Expected result:
The page output is expected to have an error report something like:

Parse error: syntax error, unexpected 'is' (T_STRING) in /path/to/a.php on line 3

Actual result:
The outputted page is blank. No php error report or anything at all.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-15 03:32 UTC]
the same as #60523. since that one has been assigned, so I am going to close this 
one, thanks
 [2011-12-15 03:32 UTC]
-Status: Open +Status: Duplicate
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 03:03:34 2022 UTC