Home > php5 > Quickly turn on error reporting to see errors.

Quickly turn on error reporting to see errors.

I frequently run into a page where php isn’t displaying errors… A quick way to turn them on without changing the php.ini file is:

error_reporting(E_ALL & ~E_DEPRECATED);

ini_set('display_errors', 'on');

Note: This will not show compile / fatal errors, as the page won’t even run, but if it’s just a regular non syntax related error, it will not be displayed.

Update Thanks for the way to remove deprecated warnings Jacob.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
Categories: php5 Tags:
  1. July 13th, 2011 at 14:34 | #1

    Good snippet! I like to exclude E_DEPRECATED so I don’t get “false” error messages:

    ini_set(‘error_reporting’, E_ALL & ~E_DEPRECATED);

  1. No trackbacks yet.