curl导致的nginx 502问题记录

使用brew安装的(或者mac自带的curl)不支持openssl,在使用ping++ sdk执行curl_exec时就会出现Nginx返回502。

查看php-fpm.log发现php-fpm有子进程异常退出了。

[13-May-2017 00:00:10] WARNING: [pool www] child     30781 exited on signal 11 (SIGSEGV) after     6293.062114 seconds from start
[13-May-2017 00:00:10] NOTICE: [pool www] child 45460 started

解决方案:卸载重装curl,执行如下命令:

brew uninstall --ignore-dependencies curl

brew install curl --with-openssl

然后需要将环境变量写入到.zshrc中:

export PATH="/usr/local/opt/curl/bin:$PATH"

最后重启php-fpm即可:

php56-fpm restart