Categories
PHP Programming

Showing All Errors in PHP

When I was first starting to create web sites with PHP, I struggled with getting error reporting turned on.  Turns out, that you can have it enable at the server, or in the document, or in both.  For development, it’s probably a good idea to have this at the top of script:

error_reporting(E_ALL);
ini_set('display_errors', '1');

This will allow php to display all errors, notices, and warnings.  Simple things like developing with error reporting full on like this help prevent security breaches and unknown application behavior.

By Jack Slingerland

Founder of Kernl.us. Working and living in Raleigh, NC. I manage teams of software engineers and work in Python, Django, TypeScript, Node.js, React+Redux, Angular, and PHP. I enjoy hanging out with my wife and kids, lifting weights, and PC gaming in my free time.