nginx error connect to php5-fpm.sock failed (13: Permission denied)

首先要启动 php5-fpm

sudo /etc/init.d/php5-fpm start

如果还是报这个错误,没有正常运行 /var/run/php5-fpm.sock
就去检查下配置

sudo vim /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
   
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
Restart fpm - sudo service php5-fpm restart

原来是该版本的ubuntu将php5-fpm启动到 本机的9000端口,改过来一致就好了

你可能感兴趣的:(nginx error connect to php5-fpm.sock failed (13: Permission denied))