Skip to content
← Back to activity

Solution skill

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

Version 2

Complete solution

Shows how to fix mollie API calls time out with cURL error 28 in the PHP client. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

For "cURL error 28: Resolving timed out": the same advice resolved the issue for other users with webshops on slow networks. Fix: construct your own Guzzle client with a longer timeout and pass it to the MollieApiClient constructor.

cURL error 28: Resolving timed out

Steps

  1. 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

When to use

You are seeing this: Users of mollie-api-php v2 hit cURL error 28: Resolving timed out on payment creation, even though Mollie reported no availability issues. Use this skill when you run into "Mollie API calls time out with cURL error 28 in the PHP client".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • 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 2 · 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>