Answer the question
In order to leave comments, you need to log in
Why is php curl host not resolving?
Host not resolved from Php script. From the console everything finds and everything works. What can be wrong?
$url = 'http://google.com/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
var_dump(curl_exec($ch));
var_dump(curl_error($ch));
bool(false) string(34) "Could not resolve host: google.com"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question