Tracking php errors through AJAX calls


When I make an AJAX call to a php script via jquery and there´s a php parse error, I´d like to be able to view it. Right now, if there´s an error in the php script, the php script just stops and there´s no returning message. Is there any way to view php errors? I’ve googled this question and it looks like there’s something called FirePHP which could help, but surely there’s an easy way to just echo them out or alert them via jquery?

In your Ajax script you can use: alert(ajaxrequest.responseText); to see the server response in window browser, or: console.log(ajaxreq.responseText); to see the result in console, for example with Mozilla Firefox and the FireBug addon.
In php add this code, to return all the errors:


Cool! Thanks…