Drupal: How to Show PHP Notifications
If you need to test your site, you may wish to view PHP notifications (error reporting) that include error notices and warnings in your browser. In this article, I would tell how you can do this.
Solutions:
Enable PHP notifications on error Reporting page
- Open “Error reporting” page:
- Drupal 6: admin/settings/error-reporting
- Drupal 5: admin/settings/error-reporting
- Set “Error reporting” parameter at the bottom of the page to “Record errors to the system log”. Thus, errors will be logged and user won’t see them.
Enable showing of warnings in php.ini
You can enable showing of errors in php.ini (this is PHP configuration file). To do this, find error_reporting parameter in php.ini:
error_reporting = E_ALL
Enable showing of notifications in .htaccess
You can change showing of errors on a remote server that maintains .htaccess. To do this, add the following line to .htaccess in the root of a site:
php_value error_reporting E_ALL
One more option:
php_flag display_errors on
php_flag display_startup_errors on
Enable error reporting in the code of PHP-scripts
Other way you can enable error reporting with is to add the following code:
error_reporting(7);
in /index.php file before this line:
require_once ‘./includes/bootstrap.inc';
Good luck!