How to turn off PHP error formatting for getting only plain text? This should also affect MySQL related functions.
I want to get plain text, instead of structured HTML error message.
UPDATE
AS Artefact2 suggested I need to modify php.ini file, so
ini_set('html_errors', false);
does the trick if I need it in realtime.
To turn off or disable error reporting in PHP, set the value to zero. For example, use the code snippet: <? php error_reporting(0); ?>
Prepend functions with the '@' symbol to suppress certain errors, as opposed to turning off all error reporting. PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
Look for the entry Configuration File (php. Find the Error handling and logging section of the php. ini file. Make sure that both display_errors = On, display_startup_errors = On and log_errors = On are present and uncommented. Check the value of error_log - this tells you the location of the file errors are logged to.
http://www.php.net/manual/en/errorfunc.configuration.php#ini.html-errors
Just set html_errors to "Off" in your php.ini.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With