当前位置:首页 > 操作系统 > MacOs

mysql – 502 Bad Gateway Nginx Mac OS X Yosemite php56 php-fpm

我是Brew’ing PHP, MySQL & Nginx on Mac OS X,但我无法做到这一点.

知道我做错了什么吗?

phpinfo正在工作

/log/nginx/access.log

127.0.0.1 - - [14/Mar/2015:21:21:16 -0500] "GET /wp/wp-admin/install.php HTTP/1.1" 502 574 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2331.4 Safari/537.36"

/log/virtualhost/error.log

2015/03/14 21:21:16 [error] 82682#0: *59 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /wp/wp-admin/install.php HTTP/1.1", upstream: "fastcgi://unix:/usr/local/var/run/php-fpm/php-fpm.sock:", host: "localhost"

/log/php-fpm.log

[14-Mar-2015 21:21:16] WARNING: [pool www] child 6851 exited on signal 11 (SIGSEGV) after 11147.271614 seconds from start
[14-Mar-2015 21:21:16] NOTICE: [pool www] child 82712 started

我的Nginx conf
/usr/local/etc/nginx/nginx.conf

worker_processes  1;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    include sites-enabled/*.conf;
}

我的Nginx虚拟服务器conf
/usr/local/etc/nginx/sites-available/local.conf

server {
  listen                *:80;
  server_name           localhost;
  error_log            /log/virtualhost/error.log;
  root                 /server;
  location / {
    try_files  $uri  $uri/  /index.php?$args;
    index index.php;
  }
  location ~ .php${
    fastcgi_index   index.php;
    fastcgi_pass    unix:/usr/local/var/run/php-fpm/php-fpm.sock;
    include         fastcgi_params;
    fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;
  }
}

我的php-fpm conf
/usr/local/etc/php/5.6/php-fpm.conf

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
;user = _www
;group = _www
listen = /usr/local/var/run/php-fpm/php-fpm.sock

解决方法:

我遇到了这个问题并通过使用不同的选项重新编译php来解决它:

brew uninstall php56 && brew install php56 --with-debug --without-apache

似乎是原始构建出了问题,可能是那些标志或者可能是工具链.我似乎记得它抱怨第一次没有xcode cli工具,然后安装它们并再次运行构建.无论哪种方式,这对我有用.

你的FPM日志中的SIGSEGV意味着“分段错误”,这是错误的错误……我认为PHP的内容,而不是配置的东西……当然有更聪明的人可以扩展它;-)


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐