Possible Duplicate:
header() error not shown in php
My /etc/php5/apache2/php.ini
file has the next configuration:
display_errors = On
log_errors = On
error_reporting = E_ALL | E_STRICT
and I can view errors like Undenifed variable
, Parse error
and so on in the browser, but with the next code
<!DOCTYPE html>
<?php
header('hola: adios');
?>
I can't see the Headers already sent
error. Also with the Developer tools of Chrome I can see that the header hola: adios
is set. How could I see those type of errors? Thanks.
It is not showing you an error because it is NOT! the function is
header(string,replace,http_response_code)
where string may be anything you wanna set as a header field:value. There isn't a list what can be used or what not. You can always have custom header fields.
check the manual - http://php.net/manual/en/function.header.php.
<?php
header('inappropriate stuff');
?>
try this and you wont be getting anything in header packet since php can't find a colon ':' as a separator inside the string which separates the header field from the value.
NOTE: If you plan to use it with session, session_start() must be the first function to run at the beginning of your execution.