When I\'m developing my REST API in PHP I\'m working with application/json output, so when I get errors while testing in the browser they look like this:
There may be some configuration option that I can't find to do this - I suspect there is, since the HTML is not present on the command line.
A dirty work around is to pass the strings through html_entity_decode(strip_tags($str)).
EDIT As Andy Pieters has pointed out (he is obviously better at reading docs than I am) there is a configuration option called html_errors to control this. I will leave this answer here in case for some reason you cannot modify this, but you should probably accept his answer.