Drupal: Enable Displaying of PHP Alerts and Errors
This article would tell you how to show PHP alerts and errors.
Solutions:
Enable showing of all errors on the Drupal settings page
- Open “Error reporting” page
- Drupal 6: admin/settings/error-reporting
- Drupal 5: admin/settings/error-reporting
- Below the page, set “Error reporting” parameter to “Record errors to log file”. This way errors will be logged and will not be shown in user web-browser.
Enable errors output to php.ini
You can change level of errors output in php.ini file (configuration file PHP). To do so, it is necessary to find error_reporting parameter in php.ini file:
error_reporting = E_ALL
Enable errors output to .htaccess file
You can change errors output level on remote server supporting .htaccess by adding the following line to .htaccess file located in the root of your site:
php_value error_reporting E_ALL
Another option:
php_flag display_errors on
php_flag display_startup_errors on
Enable errors output in PHP-scripts code
Enabling notifications and alerts output is possible if you add the following code:
error_reporting(7);
before this line in index.php file:
require_once ‘./includes/bootstrap.inc';
Good luck!