PHP Error Monitoring with Raygun

Easily detect, diagnose and fix Node.js errors

Solving PHP errors has never been so easy!

Detect, diagnose and destroy PHP errors that are affecting your customers. With smart PHP error monitoring software from Raygun, you can be alerted to issues affecting your users, the second they happen.

Raygun supports all major programming languages and platforms including PHP, Laravel, Symfony, Codeigniter, Wordpress, Magento, JavaScript, .NET and more.

Whatever your tech stack looks like, or whether you’re monitoring backend or frontend code, Raygun can ensure all issues are brought to your team’s attention. All your errors are reported to your Raygun dashboard automatically.

Getting started - It's quick and easy


Add code snippets

This method uses the Composer dependency management system. If you wish to manually install it, see the GitHub documentation.

Add raygun4php to your composer.json file:

  "require": {
    "mindscape/raygun4php": "^2.0"

From the directory where composer.json is, run one of the following if you installed Composer locally:

php composer.phar install

Or like this if you installed it Composer globally

This will download Raygun4PHP.

composer install

Add this code to an existing main class, or create a new file and import it from a main script.

namespace {
  require_once 'vendor/autoload.php';

  use GuzzleHttp\Client;
  use Raygun4php\RaygunClient;
  use Raygun4php\Transports\GuzzleAsync;

  $httpClient = new Client([
    'base_uri' => '',
    'headers' => ['X-ApiKey' => 'TWx4EvgIPEsxTKTnMrbFaQ']
  $transport = new GuzzleAsync($httpClient);
  $raygunClient = new RaygunClient($transport);

  set_error_handler(function($errno, $errstr, $errfile, $errline) use ($raygunClient) {
    $raygunClient->SendError($errno, $errstr, $errfile, $errline);
  set_exception_handler(function($exception) use ($raygunClient) {
  register_shutdown_function(function() use ($raygunClient) {
    $lastError = error_get_last();

    if (!is_null($lastError)) {
      [$type, $message, $file, $line] = $lastError;
      $raygunClient->SendError($type, $message, $file, $line);
  register_shutdown_function([$transport, 'wait']);

Start Sending data!

Raygun will start monitoring your application for PHP errors that are present in your application. Errors are grouped by their root cause and smart notifications alert you to the things that need attention.

Start fixing the PHP errors and improve your app quality!

Don’t rely on your users to report errors

14 day free trial - no credit card required!

PHP Error Monitoring Features

Raygun4PHP is a library you can easily add to your PHP-based code, which then allows you to transmit all errors and exceptions to your Raygun Crash Reporting dashboard. Installation is painless, and configuring your site to start real time error monitoring and crash reporting takes only five minutes.

Raygun’s support for PHP is designed to send both classical PHP errors, as well as PHP5 exception objects by providing Send() functions. You can add a set of tags (as an array of strings) to identify a certain error, add custom user data and customize how errors are grouped.

Raygun gives you full stacktraces for each and every error occurrence, along with environment information, HTTP requests, raw data, browser, OS, affected users and more. All the details you need to rectify issues quickly and efficiently. Raygun stores every single error event (no data sampling) so you’ll always have the right information at hand when needing to see when, why and how an error occurred.

  • Rather than be bombarded with a flood of messages and error emails, Raygun silently monitors your applications in the background and offers smart alerts for you when need to take action. Notifications are fully customizable, but repeating error instance emails and team chat alerts are sent only when issues are recurring or getting worse, resulting in more signal, and less noise.
  • Raygun allows you to set inbound filters to remove the reporting of errors you don’t care about or cannot fix, meaning you’ll be able to see the problems that are highest priority and affecting the largest amount of users. Choose what you want to monitor with custom setup for dealing with private user details and sensitive information, you can do it all.

It takes minutes to set Raygun up - seriously

Simply add a short PHP code snippet and deploy your application into production, that’s all you need to start monitoring your application for PHP errors. Start fixing bugs within minutes!
More about Crash Reporting

Raygun also supports your backend

Don’t rely on your users to report errors

14 day free trial - no credit card required!

Supports all major web and mobile programming languages

View all languages

Integrates with the workflow tools you use everyday

View all integrations

Solve your PHP errors with Raygun

Forget logs and support tickets. Find the answers you need with greater speed and accuracy.

Discover why 40,000+ developers love Raygun

14-day free trial - no credit card required