Page 1 of 1
Trying to view errors in PHP 5.2.1
Posted: Mon Apr 02, 2007 3:20 am
by mcccy005
I've installed PHP 5.2.1 however I can't view any errors when they occur - php just shows a blank screen if there's any errors.
I've set the following in php.ini but it does nothing:
display_errors = On
error_reporting = E_ALL & E_NOTICE & E_Strict
Originally the above was display_errors = Off and error_reporting = E_ALL
Posted: Mon Apr 02, 2007 4:18 am
by Oren
Did you restart your server?
Posted: Mon Apr 02, 2007 4:43 am
by mcccy005
WEll I did restart the computer a couple of times if that counts??
Posted: Mon Apr 02, 2007 6:32 am
by mentor
in phpinfo(), confirm the value of display_errors
Posted: Mon Apr 02, 2007 6:35 am
by dibyendrah
try putting
at the top of the page.
Posted: Mon Apr 02, 2007 6:36 am
by Oren
mcccy005 wrote:WEll I did restart the computer a couple of times if that counts??
Yes, it counts.
Posted: Mon Apr 02, 2007 7:11 am
by ryuuka
put this on top of your site just below the php opening
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
Posted: Mon Apr 02, 2007 8:32 am
by feyd
E_ALL & E_NOTICE & E_Strict
This evaluates to zero.
"E_ALL | E_STRICT" is what you want.
Posted: Tue Apr 03, 2007 6:17 am
by mcccy005
Awesome; thanks feyd - that worked a treat.
Also; thanks ryuuka; your method worked also (although means I don't have to put it at the top of each page, but could come in handy for debugging when I put it onto someone elses server)
Thanks.