Php Curl slow然后根据网站状态超时

Php Curl slow然后根据网站状态超时,php,curl,Php,Curl,我有下面的代码来检查一个网站的状态,这在大多数网站上都很有效,但与其他网站有问题 if (isset($_POST['submit'])) { $url = $_POST['url']; $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, tr

我有下面的代码来检查一个网站的状态,这在大多数网站上都很有效,但与其他网站有问题

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 "";
        }

你用HTTPS检查过了吗?是的,仍然很慢而且超时我只是复制并粘贴了你的代码,对我来说很好。我刚刚用更改了$ch和$rch$curl@AliMasudianPour慢吗?我仍然有同样的问题。不,对于所有你在你的问题中显示的url,它说起来!
 mod_fcgid: read data timeout in 45 seconds,

 Premature end of script headers: