Whether PHP displays plain text or html errors depends on your php.ini configuration:
html_errors
boolean
Turn off HTML tags in error messages. The new format for HTML errors produces clickable messages that direct the user to a page describing the error or function in causing the error. These references are affected by docref_root and docref_ext.
The setting is settable as PHP_INI_ALL
, which means anywhere, including your script. So to disable html errors do
ini_set('html_errors', false);
at the beginning of your script.