Php-fpm crashed when curl or file_get_contents requested https-url

My nginx server + php-fpm

the code below will result in an error

file_get_contents('https://github.com');

or

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

webpage shows error 502

nginx log

[error] 2656 # 0: * 541 recv () failed (104: Connection reset by peer) while reading the response header upstream

fpm log

Jul 03 00: 37: 37.619903 [NOTICE] fpm_got_signal (), line 48: received SIGCHLD

Jul 03 00: 37: 37.619926 [WARNING] fpm_children_bury (), line 215: child 3567 (default pool) exited signal 11 SIGSEGV (core is reset) after 417.576755 seconds from the start

Jul 03 00: 37: 37.620807 [NOTICE] fpm_children_make (), line 352: 4193 child device started (default pool)

If the request URL starts with http: //, everything is fine.

Team

php configure

'./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'
+3
source
1

:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

SSL-. , . , 2 cURL.

PS: , .

0

All Articles