# Catch all global errors

**URL:** <https://forum.kirupa.com/t/catch-all-global-errors/304699>\
**Category:** programming\
**Created:** [February 12, 2010, 1:42am UTC](https://forum.kirupa.com/t/catch-all-global-errors/304699 "2010-02-12T01:42:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [February 12, 2010, 1:42am UTC](https://forum.kirupa.com/t/catch-all-global-errors/304699/1 "2010-02-12T01:42:31Z")

</div>

I’m wanting to create an error handler for a PHP site.

Sadly, there are A LOT of pages, so adding error handling everywhere there could possibly be an error could get quite heavy, and I have already done most of the coding, so I’m too lazy to go back and change anything. 😛

Luckily, all pages go through the “index.php” page first, so is there any code I can add there (or anywhere else for that matter) that will run a specific function in case any errors occur?
