James Andino
James Andino

Reputation: 25779

PHP how do I turn on the in browser error logging

For example if my PHP script throws an error I want it to print to the browser. I am on a linux box Debian 5.0

Upvotes: 1

Views: 850

Answers (2)

Arnaud Le Blanc
Arnaud Le Blanc

Reputation: 99909

Set the ini variable display_error to 1, to display errors to the browsers.

Upvotes: 1

Naftali
Naftali

Reputation: 146300

Put this that the top of your php file:

//*DEBUG ERROR REPORTING
ini_set('display_errors', 1); 
ini_set('log_errors', 1); 
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); 
error_reporting(E_ALL);
//END DEBUG ERROR REPORTING*/

Upvotes: 2

Related Questions