Pages

Showing posts with label display erros. Show all posts
Showing posts with label display erros. Show all posts

How do I get PHP errors to display?

Its easy to display php errors 

test.php for testing work php error 

echo "test"
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);



//output error:  Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\test.php on line 7

Inside your php.ini:
display_errors = on
Then restart your web server.

/*
This always works :

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

However, this doesn't make PHP to show parse errors - the only way to show those errors is to modify your php.ini with this line:

display_errors = on

*/

Popular Posts