Skip to content

Instantly share code, notes, and snippets.

@AnthonyVadala
Last active June 19, 2018 03:20
Show Gist options
  • Save AnthonyVadala/fcfb419d3a2056e055e8bac064b14ea8 to your computer and use it in GitHub Desktop.
Save AnthonyVadala/fcfb419d3a2056e055e8bac064b14ea8 to your computer and use it in GitHub Desktop.
Display PHP errors
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
?>
@AnthonyVadala
Copy link
Author

Modify php.ini to show parse errors

display_errors = on

@AnthonyVadala
Copy link
Author

AnthonyVadala commented Jun 19, 2018

Print internal error information

<?php
      // http://php.net/manual/en/pdostatement.errorinfo.php
      $error = $query->errorInfo();

      // See if anything is output here
      print_r($error);
?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment