How to make PHP show all errors

As a PHP programmer, I find myself Googling what the steps are to show php errors seemingly every week, so I decided to make myself a website dedicated to this simple task to see if it helps me remember it!

There are several methods of doing this, but I’ve found that the easiest way to display all PHP errors and warnings is to simply place the following two lines of code at the top of your script:

error_reporting(E_ALL);
ini_set('display_errors', '1');
php-errors