【发布时间】:2013-06-30 14:58:43
【问题描述】:
我的服务器是 nginx + php-fpm
下面的代码会导致错误
file_get_contents('https://github.com');
或
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://github.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch); //crash here
curl_close($ch);
网页显示502错误
nginx日志是
[error] 2656#0: *541 recv() failed (104: Connection reset by peer) while reading response header from upstream
fpm 日志是
7 月 3 日 00:37:37.619903 [通知] fpm_got_signal(),第 48 行:收到 SIGCHLD
7 月 3 日 00:37:37.619926 [警告] fpm_children_bury(),第 215 行:子 3567(池默认)在信号 11 SIGSEGV(核心转储)上退出 417.576755 秒后
7 月 3 日 00:37:37.620807 [通知] fpm_children_make(),第 352 行:子 4193(池默认)开始
如果请求 url 以 http:// 开头,则一切正常。
php配置命令是
'./configure' '--prefix=/www/nginx_php-5.2.17' '--with-config-file-path=/www/nginx_php-5.2.17/etc' '--with-mysql=/www/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--enable-sockets' '--enable-zip' '--enable-fastcgi' '--enable-fpm' '--with-fpm-conf=/www/etc/php-fpm.conf'
【问题讨论】:
-
崩溃检查后
curl_error()你会看到更多信息 -
我也有同样的问题。你找到解决办法了吗?
-
我遇到了同样的问题。如果您确实找到了解决方案,请不吝赐教。