Search code examples
phpheadererror-reporting

header() error not shown in php


I wrote a PHP program, I use session_start() and header() functions, I know I should use this functions before I sending anything to client. it's ok, but for test I send a test message to client with echo "test"; before using header(), but I didn't get any error and header function work without any problem !

In previous versions of PHP at this time I will got a message like :

Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:22) in /some/file.php on line 60

I wan't to know why I didn't get any error message ?!

My php version is 5.3.1 and error_reporting is on E_ALL


Solution

  • I found the problem, I don't use any FrameWork.

    the problem was error_reporting('E_ALL');

    I wrote this code on first of my program, and so PHP didn't return any errors ! I deleted this line and I get the errors !

    This is kidding because this line said to PHP to show ALL errors ! I don't know why PHP don't show any errors.