Set up your SDK
Connect your PHP application to Bugsink to start tracking errors.
Bugsink is compatible with the
Sentry SDK.
Note that the instructions for
Laravel and
Symfony are quite different from plain PHP.
In the below we provide an overview, zoom in on the differences between Bugsink and Sentry, and provide a snippet with the correct DSN set.
Step 1: Install the SDK
Install the SDK using Composer. Run either of the following commands:
{% code %}:::text
PICK ONE:
composer require sentry/sentry
composer require sentry/sentry-laravel
composer require sentry/sentry-symfony
{% endcode %}
Step 2: Configure the SDK with your DSN
The steps for initialization/configuration differ between the different frameworks. Refer to the relevant
document.
Configure the SDK without tracing and profiling, as Bugsink does not support these features.
Initialize and configure the SDK with your DSN:
{% code %}:::php
{{ dsn }}
{% endcode %}
Step 3: Verify the setup
To verify that everything is working, raise an exception on purpose and check that it appears in Bugsink.
How to do this depends on the framework you are using, as per the documentation. Here's an example for plain PHP:
{% code %}:::php
iWantThisToFailSoBugsinkShowsIt();
} catch (\Throwable $exception) {
\Sentry\captureException($exception);
}
?>{% endcode %}
Further reading