How can PHP error reporting be activated to identify syntax errors in scripts?

To activate PHP error reporting to identify syntax errors in scripts, you can set the error_reporting level to E_ALL and display errors by setting display_errors to On in your PHP configuration or at the beginning of your script.

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