I’m trying to implement Sentry in our application.
I’ve used sentry/sdk
as a first attempt, but got some errors (probably due to some PHP settings), so I’m now trying to switch the transport method.
I removed sentry/sdk
from my composer.json file and replaced it with sentry/sentry
and php-http/guzzle7-adapter
. Please note that in the documentation, the guzzle6-adapter
has been used, but that gave dependency errors (I was already using "guzzlehttp/guzzle": "^7.3"
, so I need to use version 7).
When now trying to initialize Sentry, I get the following error:
Fatal error: Uncaught Http\Discovery\Exception\DiscoveryFailedException: Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors - Puli Factory is not available - No valid candidate found using strategy "Http\Discovery\Strategy\CommonClassesStrategy". We tested the following candidates: . - No valid candidate found using strategy "Http\Discovery\Strategy\CommonPsr17ClassesStrategy". We tested the following candidates: Phalcon\Http\Message\StreamFactory, Nyholm\Psr7\Factory\Psr17Factory, Zend\Diactoros\StreamFactory, GuzzleHttp\Psr7\HttpFactory, Http\Factory\Diactoros\StreamFactory, Http\Factory\Guzzle\StreamFactory, Http\Factory\Slim\StreamFactory, Laminas\Diactoros\StreamFactory, Slim\Psr7\Factory\StreamFactory. in vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php:41
It is a custom application, so I cannot use e.g. the Sentry Laravel package.
I’m using Sentry\init()
with options, initializing it in a singleton.