我收到以下错误消息:get_headers failed to open stream: Connection timeout
以下是代码:
$file_headers = @get_headers('http://www.example.fr');
print_r(get_headers('http://www.example.fr'));
if ( strpos( $file_headers[0], "200" )) {
echo 'done';
} else {
echo 'error';
}
答案 0 :(得分:0)
程序无法在时间限制内打开流 - 系统默认值,通常为60秒。检查文件是否存在且可读。请注意,您第二次调用 get_headers (在打印语句中),而 file_headers 流仍处于活动状态。
答案 1 :(得分:0)
将此设置为120秒超时(默认值为60):
val