我有以下代码来检查网站的状态,这在大多数网站上运行良好,但与其他网站有问题
if (isset($_POST['submit'])) {
$url = $_POST['url'];
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_FORBID_REUSE, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_exec($curl);
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($code == 200) {
echo "<h3>Up!</h3>";
} else {
echo "";
}
以下网站完美运作ebay.com, stackoverflow.com
但不是google.com, blackberry.com and facebook.com.
它变得非常缓慢而且超时。
我已经阅读了错误日志,这就是我找到的
mod_fcgid: read data timeout in 45 seconds,
Premature end of script headers: