Guzzle needs cURL or allow_url_fopen

Guzzle throws that handler exception when the PHP process has no curl extension and allow_url_fopen is off. Enable curl for the binary in the stack trace.

Last updated: October 27, 2026

Magento uses Guzzle for HTTP. Guzzle’s default handler is curl, then PHP streams if curl is missing. If both are unavailable, you get:

Illustration of the Guzzle exception that asks for cURL, allow_url_fopen, or a custom HTTP handler.
Illustration. Guzzle stops with this exception when the PHP process has neither cURL nor allow_url_fopen.
RuntimeException: GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.

Enable the curl extension for the PHP process that threw the error. Do not turn on allow_url_fopen as the first fix. That setting lets fopen and file_get_contents open remote URLs, which you do not want on a shop.

See which PHP failed

The stack trace path tells you CLI versus the web server. bin/magento uses the CLI php.ini. A storefront or cron hit uses FPM or Apache. They differ on Windows and on many Linux panels.

php -m | grep -i curl
php -r "echo 'allow_url_fopen=', ini_get('allow_url_fopen'), PHP_EOL;"
php --ini

Windows:

php -m | findstr /i curl
php --ini

php -m without curl, while a browser phpinfo() shows curl, means you edited the web config and the CLI is what failed. Or the reverse.

Enable curl

Debian and Ubuntu:

sudo apt-get install php-curl
sudo systemctl restart php8.3-fpm

Use the PHP version the shop runs. php-curl without a version can install the wrong one.

Windows, in the php.ini from php --ini:

extension=curl

Restart Apache or the service that embeds PHP. Then run php -m again. You want a line that says curl.

allow_url_fopen can stay 0. Guzzle will use curl. Confirm the line in the ini that php --ini printed, not in a second copy of the file that PHP never loads. A module that passes handler as an empty array forces this exception even when curl is loaded, so read the new Client call in the stack trace before you edit php.ini a second time.

Cron and bin/magento use the CLI binary. A storefront request uses php-fpm or Apache. Enable curl in both ini files when both paths throw the exception. php -m after you restart only proves the binary you just ran.

Guzzle’s handler order is curl, then PHP streams. Streams are what allow_url_fopen turns on. Leaving that off and loading curl is the configuration Magento expects for outbound HTTP. A custom handler is the third option in the exception, and it belongs in the module that constructed the client, not in php.ini.

Check the result

Repeat the action that threw: a compile step, a payment callback, or the cron that logged the exception. var/log/exception.log should not gain a new copy of that RuntimeException. php -m lists curl for the same binary named in the stack trace.

If that does not work

  • The extension line is correct and PHP still warns Unable to load dynamic library 'curl'. On Windows, libcurl or OpenSSL DLLs are not on the Apache PATH. The XAMPP PHP directory has to be the one Apache loads. Copying random DLLs between PHP versions breaks the next extension.
  • curl loads and the next error is an SSL certificate problem talking to repo.magento.com or a payment host. That is curl.cainfo, not this exception.
  • A custom Guzzle client was constructed with 'handler' => null or an empty handler stack. The message is the same. Search app/code for new Client. A custom handler belongs in that client, not in php.ini.

References

On this page

Related solutions

Related Tools

Related articles

Need a tool for this ?

Open the free tools — no signup.

FAQs

Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.