Reputation: 231
My application was working fine and when I woke up today i faced this error:
Call to undefined method GuzzleHttp\Utils::chooseHandler(
/opt/bitnami/apache/htdocs/php/plain/vendor/guzzlehttp/guzzle/src/HandlerStack.php:42
function choose_handler(): callable
{
return Utils::chooseHandler();
}
This is when the error happens:
Mail::to($request->email)->send(new ProfessionalInvited($clinic, $person, $inviteId));
What could happened? And what should I do? I already tried deleting my vendor and composer.lock and reinstall everything. But without success. I was also having this error in API calls using guzzle and when I changed to cURL everything worked fine. But I dont think I can do the same to send emails since Guzzle is a dependency.
Upvotes: 5
Views: 10865
Reputation: 71
I ran into the same problem developing a WordPress plugin with a Guzzle dependency. The issue was another plugin using a different version of Guzzle.
See also "MAJOR_VERSION undefined class constant in src/utils.php": https://github.com/guzzle/guzzle/issues/2744
Upvotes: 0
Reputation: 111839
Hard to say what exactly happened but I can guess:
chooseHandler
method in Utils
class (or it was reinstalled somehow on server).composer dump-autoload
I verified it and this method and class exists in Guzzle 7.x version and it's also mentioned in documentation.
Upvotes: 0