【问题标题】:HTTPS requests with curl or file_get_contents cause php crashes带有 curl 或 file_get_contents 的 HTTPS 请求导致 php 崩溃
【发布时间】:2016-03-08 15:01:18
【问题描述】:

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

PHP 版本 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-sockets' '--with-ldap' '--with-ldap-sasl' '--with-xmlrpc' '--enable-zip' '--enable-soap'

php-fpm.log

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

6 月 18 日 10:03:08.884945 [通知] fpm_got_signal(),第 48 行:收到 SIGCHLD

6 月 18 日 10:03:08.885008 [警告] fpm_children_bury(),第 215 行:子 8665(池默认)在 33.717855 秒后在信号 11 SIGSEGV 上退出

6 月 18 日 10:03:08.885573 [NOTICE] fpm_children_make(), line 352: child 8689 (pool default) 开始

6 月 18 日 10:03:09.689830 [警告] fpm_stdio_child_said(),第 167 行:子 8606(池默认)在标准错误中说:“[2012 年 6 月 18 日星期一 10:03:09”225

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 (bad gate way) 错误。

如何找到原因?

【问题讨论】:

  • 这个 502 究竟是从哪里来的?您正在向自己的服务器发出请求?其他一些网站返回 502?每当您从其他网站请求 ssl 内容时,您的服务器就会输出 502?
  • 向其他服务器请求,我自己的php脚本在调用curl_init()或file_get_contents()时返回502。
  • 然后查看服务器错误日志以获取更多详细信息。您在浏览器中获得的内容故意含糊不清,以防止泄露内部配置详细信息
  • 问题已更新,php-fpm.log 添加
  • 为什么这个问题被否决了?

标签: php https


【解决方案1】:

前几天遇到一个很像这样的问题,我的系统是Linux CentOS6.2, 最后我用 CentOS 5.6 ,问题解决了, 我认为原因是系统版本和openSSL版本不匹配,
我的英文不是很好,希望对你有帮助

【讨论】:

    【解决方案2】:

    这是 libcurl 的问题。

    确保 libcurl 支持 openssl。

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

    【讨论】:

      猜你喜欢
      • 2013-06-30
      • 1970-01-01
      • 2017-01-06
      • 1970-01-01
      • 1970-01-01
      • 2011-01-24
      • 2020-08-17
      • 2020-10-29
      • 1970-01-01
      相关资源
      最近更新 更多