Answer the question
In order to leave comments, you need to log in
get_headers() and cUrl not working?
Tell me why get_headers() might not work and cUrl get_headers('https://мой-сайт.ру/')
freezes and returns a TimeOut error
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://мой-сайт.ру/');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$data = curl_exec($ch);
curl_close($ch);
var_dump($data);
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