How to enable error reporting in PHP

When you are developing something new in PHP you might want to enable error reporting so you can see what is going wrong and that you are working by the strict guidelines of PHP.

With this you can enable displaying errors in your browser and you can also save it to an error log if you want.

Note for PHP5.3 and above, E_ALL includes E_STRICT so you can leave out the “| E_STRICT” part.



You can also use these in your php.ini if you want.