【问题标题】:PHP CURL suddenly stops working with error:- Could not resolve hostPHP CURL 突然停止工作并出现错误:- 无法解析主机
【发布时间】:2021-09-25 19:46:01
【问题描述】:

几个月以来,我们一直在使用相同的脚本和配置,并且运行良好。突然,卷曲在几个小时前开始失败,出现无法解析主机的错误。我用邮递员测试了主机,它可以工作。我也将主机更改为 google.com,但得到了同样的错误。

没有在一夜之间更改任何机器或服务器配置。

任何指针..这对我们来说是一个生产停止。

这是来自 curl 的错误日志

array(26) {
  ["url"]=>
  string(37) "https://google.com/callback/abcd"
  ["content_type"]=>
  NULL
  ["http_code"]=>
  int(0)
  ["header_size"]=>
  int(0)
  ["request_size"]=>
  int(0)
  ["filetime"]=>
  int(-1)
  ["ssl_verify_result"]=>
  int(0)
  ["redirect_count"]=>
  int(0)
  ["total_time"]=>
  float(0.000121)
  ["namelookup_time"]=>
  float(0)
  ["connect_time"]=>
  float(0)
  ["pretransfer_time"]=>
  float(0)
  ["size_upload"]=>
  float(0)
  ["size_download"]=>
  float(0)
  ["speed_download"]=>
  float(0)
  ["speed_upload"]=>
  float(0)
  ["download_content_length"]=>
  float(-1)
  ["upload_content_length"]=>
  float(-1)
  ["starttransfer_time"]=>
  float(0)
  ["redirect_time"]=>
  float(0)
  ["redirect_url"]=>
  string(0) ""
  ["primary_ip"]=>
  string(0) ""
  ["certinfo"]=>
  array(0) {
  }
  ["primary_port"]=>
  int(0)
  ["local_ip"]=>
  string(0) ""
  ["local_port"]=>
  int(0)
}

string(34) "Could not resolve host: google.com"

我已经尝试重新启动 apache2 以及我的 PHP-FHM。没有任何帮助。

【问题讨论】:

标签: php api curl https


【解决方案1】:

我可以在重启我的虚拟机后解决这个问题。发生的事情是我的虚拟机用完了磁盘。这导致许多进程停止。当磁盘最终可用时,除了一个 kprocess 之外,大多数进程都恢复了。 重新启动虚拟机完成了这项工作。我不知道如何在不重新启动机器的情况下修复它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-09
    相关资源
    最近更新 更多