Skip to content
← All PrestaShop 9 errors

PrestaShop 9 errors

Class "GuzzleHttp\Client" not found in PrestaShop 9

PrestaShop 9 no longer ships the Guzzle HTTP library. Modules that call external APIs (payment, shipping, feeds, ERP) with GuzzleHttp\Client fail unless they bring their own copy.

The error
Class "GuzzleHttp\Client" not found
Removed in
PrestaShop 9.0
Usually found in
Payment, shipping, marketplace and ERP modules

What happened

Up to version 8, PrestaShop included the Guzzle library for its own HTTP requests, and many modules used it without including it themselves: new GuzzleHttp\Client() simply worked. PrestaShop 9.0 dropped Guzzle from the core.

A module that relied on the core's copy now fails at the first request with Class "GuzzleHttp\Client" not found. These are usually modules that talk to an outside service: payment gateways, carrier rates and labels, product feeds, marketplaces, ERP or accounting sync.

That makes this error expensive. The store looks normal, but carriers disappear from checkout, payments fail, or stock stops syncing.

The fix

The module has to carry its own HTTP client:

  • Bundle Guzzle with the module. Add it to the module's composer.json and ship the module's vendor/ folder. Modules that already did this keep working.
  • Or use Symfony HttpClient, which PrestaShop 9 includes, if the module only targets PrestaShop 9.
  • Or check for an update. Payment and shipping providers usually publish a PrestaShop 9 version; that is safer than patching their code.
// With Guzzle bundled in the module's own vendor folder
require_once __DIR__ . '/vendor/autoload.php';
$client = new GuzzleHttp\Client(['timeout' => 10]);

When two modules bundle different Guzzle versions, the first one loaded wins, which can cause strange errors in the other. Well-made modules prefix their dependencies (for example with PHP-Scoper) to avoid this.

Where else it hides

grep -rln "GuzzleHttp" modules/ override/ | grep -v "/vendor/"

Files inside a module's own vendor/ folder are fine; the ones to worry about are module files that use Guzzle while the module has no vendor/guzzlehttp of its own.

Find every place like this before you upgrade

Where one removed call is, there are usually more. Our free PrestaShop 9 Readiness Check reads the code of every module, the theme and the overrides and lists each problem with its file and line. It only reads, nothing is changed.

Get the free check

Prefer not to fix it yourself? We upgrade stores to PrestaShop 9 for a fixed price. See the upgrade