php5.6-fpm curl 停止工作(无法解析主机)

php5.6-fpm curl 停止工作(无法解析主机)

突然间,我们的 Ubuntu php5.6-fpm 服务器停止处理 curl 请求。

以下是我发现的内容:

从控制台运行时有效php test.php

通过湿法工作console wget -qO- https://maps.google.com/maps/api/geocode/json?address=Brooklyn+NY+USA&key=AIzaSyBGgTVnShML1_WHJL0rOTEnt2XOrgVgnu4 | cat

使用 curl 进行工作console ums-admin@svr1:/var/www/propertymonitor.ae/htdocs/v2$ curl https://maps.google.com/maps/api/geocode/json?address=Brooklyn+NY+USA&key=AIzaSyBGgTVnShML1_WHJL0rOTEnt2XOrgVgnu4

但是通过 php-fpm 调用脚本https://example.com/test.php它不工作并抱怨 DNS 查找失败?!

重新启动 php5.6-fpm 它可以再次开始工作吗?!

代码如下:

<?php
// create curl resource
$ch = curl_init();

// set url
curl_setopt($ch, CURLOPT_URL, "https://maps.google.com/maps/api/geocode/json?address=Brooklyn+NY+USA&key=AIzaSyBGgTVnShML1_WHJL0rOTEnt2XOrgVgnu4");

//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// $output contains the output string
$data = curl_exec($ch);

if ($data === false)
{
echo 'Curl error: ' . curl_error($ch);
} else {
echo 'Response: ' . $data;
}

// close curl resource to free up system resources
curl_close($ch);
?>

系统其余部分检查完毕:

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
search example.com

并且没有数据包丢失:

64 bytes from 8.8.8.8: icmp_seq=3150 ttl=46 time=129 ms
64 bytes from 8.8.8.8: icmp_seq=3151 ttl=46 time=124 ms
64 bytes from 8.8.8.8: icmp_seq=3152 ttl=46 time=124 ms
64 bytes from 8.8.8.8: icmp_seq=3153 ttl=46 time=124 ms
^C
--- 8.8.8.8 ping statistics ---
3153 packets transmitted, 3153 received, 0% packet loss, time 3154312ms
rtt min/avg/max/mdev = 114.975/124.705/139.692/2.004 ms

答案1

看这里:https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1674733

更新导致了此问题。

答案2

似乎错误是固定的并释放。

apt 历史记录

相关内容