Struggling to debug php? Enable all errors

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:

{code type=php}error_reporting(E_ALL);{/code}

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 Reply

Your email address will not be published.

More Posts

How to use PHP Type Declarations

PHP has developed into a more strictly typed language in recent years. Type Declarations help with that and are a fairly new addition to PHP,


If you have come to JavaScript from a background in Java or C, then you will like the variation on the for loop. It is

Context Object Manipulation

One of the key concepts of JavaScript is the keyword this, which signifies the JavaScript context object. If you write an inner function, you can access

Polymorphic Functions

It is possible to define multiple functions with the same name in JavaScript, and the last one of those that you define will be the