【发布时间】:2021-08-08 20:27:27
【问题描述】:
我正在尝试在我们的应用程序中实现 Sentry。
我使用了sentry/sdk,但出现了一些错误(可能是由于某些 PHP 设置),所以我现在尝试切换 transport method。
我从 composer.json 文件中删除了sentry/sdk,并将其替换为sentry/sentry 和php-http/guzzle7-adapter。请注意,在文档中,他们使用guzzle6-adapter,但这会产生依赖错误(我已经在使用"guzzlehttp/guzzle": "^7.3",所以我需要使用版本7)。
现在尝试初始化 Sentry 时,出现以下错误:
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
这是一个自定义应用程序,所以我不能使用例如Sentry Laravel 包。
【问题讨论】: