Fixed bug #60523 (PHP Errors are not reported in browsers using built-in SAPI)

This commit is contained in:
Xinchen Hui 2011-12-16 19:25:03 +00:00
parent 01dc47631e
commit 80ab69876c
3 changed files with 54 additions and 1 deletions

5
NEWS
View File

@ -8,8 +8,11 @@ PHP NEWS
- CLI SAPI:
. Fixed bug #60477 (Segfault after two multipart/form-data POST requests,
one 200 RQ and one 404). (Laruence)
. Fixed bug #60523 (PHP Errors are not reported in browsers using built-in
SAPI). (Laruence, Derick)
- Pdo Firebird:
. Fixed bug #48877 ("bindValue" and "bindParam" do not work for PDO Firebird).(Mariuz)
. Fixed bug #48877 ("bindValue" and "bindParam" do not work for PDO Firebird).
(Mariuz)
08 Dec 2011, PHP 5.4.0 RC3
- Core:

View File

@ -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;
}

View File

@ -0,0 +1,49 @@
--TEST--
Bug #60523 (PHP Errors are not reported in browsers using built-in SAPI)
--SKIPIF--
<?php
include "skipif.inc";
?>
--INI--
display_errors=1
--FILE--
<?php
include "php_cli_server.inc";
php_cli_server_start('require("syntax_error.php");');
$dir = realpath(dirname(__FILE__));
file_put_contents($dir . "/syntax_error.php", "<?php non_exists_function(); ?>");
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, <<<HEADER
GET /index.php HTTP/1.1
Host: {$host}
HEADER
)) {
while (!feof($fp)) {
$output .= fgets($fp);
}
}
echo $output;
@unlink($dir . "/syntax_error.php");
fclose($fp);
?>
--EXPECTF--
HTTP/1.1 200 OK
Host: %s
Connection: closed
X-Powered-By: PHP/%s
Content-type: text/html
<br />
<b>Fatal error</b>: Call to undefined function non_exists_function() in <b>%ssyntax_error.php</b> on line <b>%s</b><br />