Y
Y
Yuriy2017-07-31 14:47:24
PHP
Yuriy, 2017-07-31 14:47:24

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);

bool(false);
connect() timed out error! If you substitute another
site, for example, yandex.ru, then everything
is fine . Display headers

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-07-31
@Sanasol

Is https something normal or even there?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question