$url = 'https://ntschool.ru/kursyi'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64;rv:38.0) Gecko/20100101 Firefox/38.0"); curl_setopt($ch, CURLOPT_REFERER, 'https://www.google.com'); curl_setopt($ch, CURLOPT_RETURNTRANSFER , true); $content = curl_exec($ch); curl_close($ch); var_dump($content); var_dump shows false, when you try to write it to the file file_put_contents ('1', $ content) creates an empty file, I don’t understand why it doesn’t work, curl does not issue any errors
$error = curl_error($ch);. There is a suspicion that ssl verification does not work, try setting theCURLOPT_SSL_VERIFYHOSTandCURLOPT_SSL_VERIFYPEERtofalse; - Yegor Banin