Installing Airbrake in a PHP Application.

Airbrake PHP

Airbrake PHP is currently community supported with most development happening on Airbrake PHP. This Read ME goes over how to Install Airbrake into your app.

Prerequisites:

  • php-json
  • php-curl
  • git

1) In your web projects root folder add 'composer.json'

{ 
  "require": {
    "dbtlr/php-airbrake": "dev-master"
  }
}

2) Install Composer

user@www# curl -s http://getcomposer.org/installer | php
user@www# php composer.phar install

3) Include the Airbrake exception handler:

<?php
require_once 'vendor/autoload.php';
Airbrake\EventHandler::start('API_KEY_HERE');
?>

Pro-Tip. Your API key is on a per project basis.
Screen_Shot_2014-01-15_at_11.20.05.png

4) You will now see errors populated in your Airbrake project control panel, example:

<?php throw new Exception('something went wrong'); ?>

For a list of further configuration options please visit. https://github.com/dbtlr/php-airbrake#configuration-options