From: Xinchen Hui Date: Fri, 16 Dec 2011 19:25:03 +0000 (+0000) Subject: Fixed bug #60523 (PHP Errors are not reported in browsers using built-in SAPI) X-Git-Tag: php-5.5.0alpha1~704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b16b7bd4b49b31815e2788740f21a7235f7fe09;p=php Fixed bug #60523 (PHP Errors are not reported in browsers using built-in SAPI) --- diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 33c37a309b..eef0fd500a 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1913,6 +1913,7 @@ static int php_cli_server_request_startup(php_cli_server *server, php_cli_server destroy_request_info(&SG(request_info)); return FAILURE; } + PG(during_request_startup) = 0; return SUCCESS; } diff --git a/sapi/cli/tests/php_cli_server_015.phpt b/sapi/cli/tests/php_cli_server_015.phpt new file mode 100644 index 0000000000..9ee7c1b100 --- /dev/null +++ b/sapi/cli/tests/php_cli_server_015.phpt @@ -0,0 +1,49 @@ +--TEST-- +Bug #60523 (PHP Errors are not reported in browsers using built-in SAPI) +--SKIPIF-- + +--INI-- +display_errors=1 +--FILE-- +"); + +list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS); +$port = intval($port)?:80; +$output = ''; + +$fp = fsockopen($host, $port, $errno, $errstr, 0.5); +if (!$fp) { + die("connect failed"); +} + +if(fwrite($fp, <<
+--EXPECTF-- +HTTP/1.1 200 OK +Host: %s +Connection: closed +X-Powered-By: PHP/%s +Content-type: text/html + +
+Fatal error: Call to undefined function non_exists_function() in %ssyntax_error.php on line %s