> ErrorCapture _

1 Download errorcapture.php

This is a single PHP file that captures errors, warnings, and fatal crashes from your application and sends them to this dashboard.

Prefer to build your own integration? See the API documentation for the raw endpoint spec.

2 Generate a project key

Each project gets a unique key. You can also do this from the dashboard.

3 Configure

Open errorcapture.php and set the two constants at the top of the file:

define('ERRORCAPTURE_ENDPOINT', 'https://errorcapture.com/api.php');
define('ERRORCAPTURE_HASH', 'your-key-here');

4 Include in your application

Add a single line at the top of your PHP application entry point:

require_once __DIR__ . '/errorcapture.php';

WordPress

Drop errorcapture.php into your theme or plugin directory and require it early. For best coverage, add it to wp-config.php before the WordPress bootstrap:

require_once ABSPATH . 'errorcapture.php';

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

Laravel

Add to the very top of public/index.php, before the autoloader:

require_once __DIR__ . '/../errorcapture.php';

require __DIR__.'/../vendor/autoload.php';

Any PHP script

Just require it at the top:

<?php
require_once 'errorcapture.php';

// your code here...

5 Log custom messages

You can also send your own messages to the dashboard using the errorcapture_log() function. These appear with the custom level.

errorcapture_log('User signed up: user@example.com');
errorcapture_log('Payment processed for order #1234');
errorcapture_log('Cache cleared manually');

The file and line number where the function was called are captured automatically.

6 View your errors

Head to the dashboard, enter your key, and errors will appear in real-time as they occur.

What gets captured

fatal Fatal errors, parse errors, compile errors
warning Warnings, core warnings, user warnings
notice Notices, strict standards
custom Messages logged via errorcapture_log()
other Deprecated, user deprecated, recoverable errors

What gets sent

Each error report includes:

{
  "hash":      "your-project-key",
  "level":     "Warning",
  "message":   "Undefined variable $foo",
  "file":      "/var/www/app/index.php",
  "line":      42,
  "hostname":  "dev-machine",
  "request": {
    "method":  "GET",
    "url":     "http://localhost/page?id=5",
    "get":     { "id": "5" },
    "post":    null
  }
}