Could not resolve host
The host does not exist (regarding the nameservers you use)
-
change namesever(s)
-
test with ping, dig , ...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
i have to make multiple hundred api requests to a 3rd party api, to gather data about multiple entities. The first ~90 work without a problem but then i receive this error in my artisan queue:listen output:
PHP Fatal error: Uncaught ErrorException: fopen(php://stderr): Failed to open stream: operation failed in...
Which lead me to this guzzle issue https://github.com/guzzle/guzzle/issues/1927#issuecomment-332328987
Opening up the log file i see that this error does come last after this one:
local.ERROR: cURL error 6: Could not resolve host: <REDACTED_FOR_SECURITY_REASON> (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for <REDACTED_FOR_SECURITY_REASON> {"exception":"[object] (Illuminate\Http\Client\ConnectionException(code: 0): cURL error 6: Could not resolve host: <REDACTED_FOR_SECURITY_REASON> (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for <REDACTED_FOR_SECURITY_REASON> at /vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:665)
Before i am getting told that it cannot resolve the host, it did just fine the first 90 requests which are all to the same domain.
I have tried closing the response stream to the tempfile created by guzzle, which did not resolve any of the problems.
UPDATEs
tried setting curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); and only check IPv4
tried calling the IP directly, resulted in ssl certificate problems, and i dont have control over the api i am calling
Using guzzle directly does not have any problems.
Please or to participate in this conversation.