php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at danielfriesen dot name
New email:
PHP Version: OS:

 

 [2011-12-12 01:13 UTC] php at danielfriesen dot name
Description:
------------
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
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL); 

require_once( "./a.php" );

# ./a.php
<?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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-15 03:32 UTC] laruence@php.net
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] laruence@php.net
-Status: Open +Status: Duplicate
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC