Show me the errors!

Tags

Depending on how your PHP is configured, it might hide some error messages from you. That sucks! It's hard to fix errors when you don't know what they are.

You can tell PHP to show you all errors. Add this at the top of your program, just after the opening PHP tag:

  • <?php
  • ini_set('display_errors', 1);
  • ini_set('display_startup_errors', 1);
  • error_reporting(E_ALL);

This tells PHP you want to see all error messages.