Open chegmarco1989 opened 2 years ago
Hello @chegmarco1989, thank you for raising this issue.
The code you posted (that I guess you got from the example) won't work because your application doesn't meet the requirements described in the readme.
A PSR-18 implementation
A PSR-17 implementation of RequestFactory and UriFactory
The OEmbed construct uses Psr18ClientDiscovery
and Psr17FactoryDiscovery
to try to detect which adapter you have and use it, otherwise, you can override it by passing the adapter as arguments to the constructor.
The easiest way to solve it would be to run composer require ricardofiorani/guzzle-psr18-adapter
or require on composer any other PSR-18 adapter of your choice.
Let me know if that helps.
Hello.
I am trying to use this library under Laragon with the following example code and of course after installing it via
composer
:And 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 - No valid candidate found using strategy "Http\Discovery\Strategy\CommonClassesStrategy". We tested the following candidates: Http\Discovery\Strategy\CommonClassesStrategy::symfonyPsr18Instantiate, GuzzleHttp\Client, Http\Discovery\Strategy\CommonClassesStrategy::buzzInstantiate. - No valid candidate found using strategy "Http\Discovery\Strategy\CommonPsr17ClassesStrategy". We tested the following candidates: . in C:\laragon\www\vendor\php-http\discovery\src\Exception\DiscoveryFailedException.php:41 Stack trace: #0 C:\laragon\www\vendor\php-http\discovery\src\ClassDiscovery.php(85): Http\Discovery\Exception\DiscoveryFailedException::create(Array) #1 C:\laragon\www\vendor\php-http\discovery\src\Psr18ClientDiscovery.php(25): Http\Discovery\ClassDiscovery::findOneByType('Psr\\Http\\Client...') #2 C:\laragon\ in C:\laragon\www\vendor\php-http\discovery\src\Psr18ClientDiscovery.php on line 27
So why this error ??? Please, help me fix this error..