PHP does not display error messages

error-handling, php

Solution

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

Problem

I installed XAMPP 1.7.4 (with PHP 5.3.5), the problem is PHP does not display any error messages. E.g. if I connect to MYSQL with `mysql_connect()` without parameters, PHP will not complain about the required fields. Why is this? How can I configure PHP to display errors?

Original source

Related problems