Curl error: couldn't connect to host
程序员文章站
2022-05-05 18:24:35
...
通过php的curlpost数据到服务器,但是偶尔会出现Curl error: couldn't connect to host,怎么破?
回复内容:
通过php的curlpost数据到服务器,但是偶尔会出现Curl error: couldn't connect to host,怎么破?
你运行curl的机器和你curl的服务器之间的网络连接不是永远是好的,一般来说要保证服务质量你不能简单地curl。
你可以试试在try ctach里面curl,然后捕获常见的网络连接异常加超时并重试的机制。超时*重试次数完毕仍然连不上就把错误信息记录下来供分析或者是自动邮件提醒。
推荐阅读
-
更换mysql数据目录后出现ERROR 2002 (HY000): Can't connect to local My
-
MySQL错误ERROR 2002 (HY000): Can't connect to local MySQL server through socket_MySQL
-
php 不能连接数据库 php error Can't connect to local MySQL server
-
php 不能连接数据库 php error Can't connect to local MySQL server
-
couldn't resolve host api.weixin.qq.com
-
MYSQL ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.10.210' (111) 解决方法
-
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
-
MySQL错误 ERROR 2002 (HY000): Can't connect to local MySQL server through socket 的解决办法
-
Linux环境邮件服务报错:Couldn‘t connect to host, port: smtp.qq.com, 25; timeout -1;
-
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)解决办法