Struggling to debug php? Enable all errors

by Carey on December 2, 2010

Post image for Struggling to debug php? Enable all errors
  • Share
  • CevherShare
  • Share

If you are having a problem debugging any php code a good thing to do is make sure all errors are showing. Simply use the following code at the beginning of your script:

error_reporting(E_ALL);

You may find that the open source code you are using or the website created by somebody else is hiding too many errors for you to work out what is going on.

Keep in mind you will also see a lot of warnings which are not always important (depending on your personal opinion) – if this is the case make sure you remove the above line after you are done.

Leave a Comment

Previous post:

Next post: