PHP header location - not displaying error?

2019-06-06 07:10发布

问题:

When I echo something before header("LOCATION: page.php"); - I expect to show an error but it didnt, it just redirect to that page. What gone wrong?

Example:

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
echo "Hello";
header("LOCATION: page.php");
?>

In the php.ini

output_buffering = off
error_reporting =  E_ALL
display_errors = on

I am using Wamp, PHP 5.3.0

回答1:

var_dump(ini_get('output_buffering'));

and what about this one

var_dump(ob_get_status(1));

?