使用file_get_contents获取http内容,返回false,链接没问题,排查file_get_contents错误
<?php
set_error_handler(
create_function(
'$severity, $message, $file, $line',
'throw new ErrorException($message, $severity, $severity, $file, $line);'
)
);
try {
file_get_contents('https://www.google.com');
}
catch (Exception $e) {
echo $e->getMessage();
}
restore_error_handler();