使用curl或file_get_contents的HTTPS请求会导致php崩溃 [英] HTTPS requests with curl or file_get_contents cause php crashes

查看:638
本文介绍了使用curl或file_get_contents的HTTPS请求会导致php崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

服务器上的php启用了openssl扩展(可以在phpinfo()中看到)

php on server has openssl extension enabled(can see in phpinfo() )

PHP版本5.2.14

PHP Version 5.2.14


'./ configure'' - prefix = / usr / local / webserver / php'' - with-config-file-path = / usr / local / webserver / php / etc '' - with-mysql = / usr / lib64 / mysql'' - with-mysqli = / usr / bin / mysql_config'' - with-iconv-dir = / usr / local'' - with-freetype- dir'' - with-jpeg-dir'' - with-png-dir'' - with-zlib'' - with-libxml-dir = / usr'' - enable-xml'' - disable -rpath'' - enable-discard-path'' - enable-safe-mode'' - enable-bcmath'' - enable-shmop'' - enable-sysvsem'' - enable-inline-optimization ''with-curl'' - with-curlwrappers'' - enable-mbregex'' - enable-fastcgi'' - enable-fpm'' - enable-force-cgi-redirect'' - enable-mbstring'' - with-mcrypt'' - with-gd'' - enable-gd-native-ttf'' - with-openssl'' - with-mhash'' - enable-pcntl' '--enable-插座' '--with-ldap'' - with-ldap-sasl'' - with-xmlrpc'' - enable-zip'' - enable-soap'

'./configure' '--prefix=/usr/local/webserver/php' '--with-config-file-path=/usr/local/webserver/php/etc' '--with-mysql=/usr/lib64/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-iconv-dir=/usr/local' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--enable-fastcgi' '--enable-fpm' '--enable-force-cgi-redirect' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-ldap' '--with-ldap-sasl' '--with-xmlrpc' '--enable-zip' '--enable-soap'

php-fpm.log

php-fpm.log


Jun 18 10:03:08.882866 [警告] fpm_stdio_child_said() ,第167行:孩子8665(默认池)对stderr说:

Jun 18 10:03:08.882866 [WARNING] fpm_stdio_child_said(), line 167: child 8665 (pool default) said into stderr: ""

Jun 18 10:03:08.884945 [NOTICE] fpm_got_signal(),第48行:收到SIGCHLD

Jun 18 10:03:08.884945 [NOTICE] fpm_got_signal(), line 48: received SIGCHLD

Jun 18 10:03:08.885008 [警告] fpm_children_bury(),第215行:从启动33.717855秒后,信号11 SIGSEGV退出子8665(默认池)

Jun 18 10:03:08.885008 [WARNING] fpm_children_bury(), line 215: child 8665 (pool default) exited on signal 11 SIGSEGV after 33.717855 seconds from start

Jun 18 10:03:08.885573 [NOTICE] fpm_children_make(),第352行:子8689(默认池)

Jun 18 10:03:08.885573 [NOTICE] fpm_children_make(), line 352: child 8689 (pool default) started

Jun 18 10:03:09.689830 [警告] fpm_stdio_child_said(),第167行:孩子8606(默认池)对stderr说:[Mon Jun 18 10:03:09 2012225

Jun 18 10:03:09.689830 [WARNING] fpm_stdio_child_said(), line 167: child 8606 (pool default) said into stderr: "[Mon Jun 18 10:03:09 2012" 225

Jun 18 10:03:09.690014 [警告] fpm_stdio_child_said(),第167行:子8606(默认池)对stderr说:] [通知] EACCELERATOR(8606):PHP在xxx.php的curl_exec()的opline 130上崩溃:383

Jun 18 10:03:09.690014 [WARNING] fpm_stdio_child_said(), line 167: child 8606 (pool default) said into stderr: "] [notice] EACCELERATOR(8606): PHP crashed on opline 130 of curl_exec() at xxx.php:383"

但是当请求时通过HTTPS,nginx返回502(坏门方式)错误。

But when request via HTTPS, nginx return 502 (bad gate way) error.

如何找到原因?

推荐答案

这是libcurl问题。

This is libcurl problem.

确保libcurl支持openssl。

Make sure libcurl with openssl support.

checking for SSL support in libcurl... yes
checking for openssl support in libcurl... yes

这篇关于使用curl或file_get_contents的HTTPS请求会导致php崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆