A PHP SDK for Sentry (

Installs: 10 822 884

Dependents: 169

Suggesters: 23

Stars: 983

Watchers: 58

Forks: 295

Open Issues: 32



Sentry for PHP

Build Status AppVeyor Build Status Total Downloads Monthly Downloads Latest Stable Version License Scrutinizer Code Quality Code Coverage

The Sentry PHP error reporter tracks errors and exceptions that happen during the execution of your application and provides instant notification with detailed information needed to prioritize, identify, reproduce and fix each issue.

Notice 2.0

The current master branch is our new major release of the SDK 2.0. We currently ship 2.0 with the beta tag, which means you have to install it by exactly providing the version otherwise you wont get 2.0. We will drop the beta tag as soon as we do no longer expect any public API changes.


To install the SDK you will need to be using Composer in your project. To install it please see the docs.

Sentry PHP is not tied to any specific library that sends HTTP messages. Instead, it uses Httplug to let users choose whichever PSR-7 implementation and HTTP client they want to use.

If you just want to get started quickly you should run the following command:

php composer.phar require sentry/sentry:2.0.0-beta1 php-http/curl-client guzzlehttp/psr7

This will install the library itself along with an HTTP client adapter that uses cURL as transport method (provided by Httplug) and a PSR-7 implementation (provided by Guzzle). You do not have to use those packages if you do not want to. The SDK does not care about which transport method you want to use because it's an implementation detail of your application. You may use any package that provides php-http/async-client-implementation and http-message-implementation.


use function Sentry\init;
use function Sentry\captureException;

init(['dsn' => '___PUBLIC_DSN___' ]);

try {
    thisFunctionThrows(); // -> throw new \Exception('foo bar');
} catch (\Exception $exception) {

Official integrations

The following integrations are fully supported and maintained by the Sentry team.

3rd party integrations

The following integrations are available and maintained by members of the Sentry community.



Dependencies are managed through composer:

$ composer install

Tests can then be run via phpunit:

$ vendor/bin/phpunit