简体   繁体   English

PHP Curl未执行错误524超时

[英]PHP Curl not executing Error 524 Timeout

Curl was working fine previously at my server but when I am trying to run php script having curl_exec , I am not able to run the script. Curl以前在我的服务器上运行良好,但是当我尝试运行具有curl_exec php脚本时,我无法运行该脚本。 It just do processing and returns 524 Timeout error. 它只是进行处理并返回524超时错误。 I have even tried the simplest curl code but still the same problem. 我什至尝试了最简单的curl代码,但仍然存在相同的问题。 When I checked on my local machine it is working fine. 当我检查本地计算机时,它工作正常。 Plz help me what can I do. 请帮我该怎么办。 I tried 我试过了

<?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);

?>

on a simple curl command and got the error in the file as 在一个简单的curl命令上并在文件中得到错误为

* 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

and also with other url on Port 443 以及Port 443上的其他网址

(Posted on behalf of the OP) . (代表OP张贴)

The problem was with the server. 问题出在服务器上。 Port 80 was blocked on my server by hosting provider. 端口80被主机提供商阻止在我的服务器上。 I contacted them and get to know about it and requested to make it active. 我与他们联系并了解有关信息,并要求将其激活。 Now everything is working fine as before. 现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM