0
Curl以前在我的服务器上工作正常,但是当我尝试运行具有curl_exec
的php脚本时,我无法运行该脚本。它只是处理并返回524超时错误。我甚至尝试了最简单的卷曲代码,但仍然是同样的问题。当我检查我的本地机器时,它工作正常。 Plz帮助我,我能做些什么。我在一个简单的curl命令试图PHP Curl不执行错误524超时
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "suhailakhtar.xyz");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$fp = fopen('curlerror.log','a');
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_STDERR, $fp);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
} else {
echo($result);
}
curl_close ($ch);
?>
,并得到了文件中的错误作为
* Rebuilt URL to: suhailakhtar.xyz/
* Hostname was NOT found in DNS cache
* Trying 31.170.164.150...
* connect to 31.170.164.150 port 80 failed: Connection timed out
* Failed to connect to suhailakhtar.xyz port 80: Connection timed out
* Closing connection 0
,并与其他网址上Port 443