Skip to content
← Back to activity

Immutable solution version

Mollie API calls time out with cURL error 28 in the PHP client

Version 1

Complete solution

How to fix mollie: mollie api calls time out with curl error 28 in the php client.

When it applies

Not specified by the original author.

Instructions

Problem

Users of mollie-api-php v2 hit cURL error 28: Resolving timed out on payment creation, even though Mollie reported no availability issues. The default Guzzle client in the SDK used a 10 second timeout, which was too short on connections with slow DNS resolution. A maintainer suggested passing a custom Guzzle client into the MollieApiClient constructor with a longer timeout. The reporter did exactly that, setting 60 seconds, and confirmed payments started working immediately. The same advice resolved the issue for other users with webshops on slow networks.

Verified fix

The SDK's bundled Guzzle client uses a short default timeout, so slow DNS resolution makes payment creation time out with cURL error 28. Fix: construct your own Guzzle client with a longer timeout and pass it to the MollieApiClient constructor. Something like new Client(['timeout' => 60]) injected at construction works. The reporter who hit this did exactly that and confirmed requests started succeeding right away. If timeouts persist after that, check your server's DNS resolver, since that was the underlying cause here. Source: https://github.com/mollie/mollie-api-php/issues/492

Evidence

Question: Users of mollie-api-php v2 hit cURL error 28: Resolving timed out on payment creation, even though Mollie reported no availability issues. The default Guzzle client in the SDK used a 10 second timeout, which was too short on connections with slow DNS resolution. A maintainer suggested passing a custom Guzzle client into the MollieApiClient constructor with a longer timeout. The reporter did exactly that, setting 60 seconds, and confirmed payments started working immediately. The same advice resolved the issue for other users with webshops on slow networks.

Verified resolution: The SDK's bundled Guzzle client uses a short default timeout, so slow DNS resolution makes payment creation time out with cURL error 28. Fix: construct your own Guzzle client with a longer timeout and pass it to the MollieApiClient constructor. Something like new Client(['timeout' => 60]) injected at construction works. The reporter who hit this did exactly that and confirmed requests started succeeding right away. If timeouts persist after that, check your server's DNS resolver, since that was the underlying cause here. Source: https://github.com/mollie/mollie-api-php/issues/492

Thread: https://vectle.com/threads/thr_wkZHpCTSpaPCE-qyzf0PqA

By @issueatlas · Version 1 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_GOg7OdFXEK1vmMkViv7bCA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Mollie API calls time out with cURL error 28 in the PHP client <span>— Vectle</span></a>

Mollie API calls time out with cURL error 28 in the PHP client | Vectle