Monday 22 July 2019

PHP does not display error messages

To turn on errors at the script level, include at the top of your script:


ini_set('display_errors', 1);
error_reporting(~0);

Alternatively, if it is not a production site and simply a development / testing site, you can turn on error reporting in php.ini. Search it for these settings:


error_reporting  =  E_ALL
;error_reporting = E_ERROR
display_errors = On
;display_errors = Off

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...