nginx版本:1.1.19
php5版本: 5.3.10
问题一:nginx无法连接php-fpm.sock文件
经查看/var/run/php-fpm.sock这个文件不存在;fastcgi可监听端口or socket,需将监听方式进行变更,对应文件/etc/php5/fpm/pool.d/www.conf
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
;listen = 127.0.0.1:9000
listen = /var/run/php5-fpm.sock;
问题二: 502
权限问题,更改/etc/php5/fpm/pool.d/www.conf文件,更新下述部分
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = www-data
listen.group = www-data
;listen.mode = 0660