在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
在编译php-fpm时,若没有指定fpm用户,在配置文件中也没有指定用户,则sock文件会由root(启动php-fpm的用户)创建,其权限是 而nginx一般由nginx用户启动,会导致无法读取sock文件,造成nginx返回502错误。 nginx日志会记录错误如下: 2018/09/12 17:06:17 [crit] 30735#0: *1 connect() to unix:/dev/shm/php-cgi.sock failed (13: Permission denied) while connecting t o upstream...... 解决办法是在配置文件中指定listen用户 ; Set permissions for unix socket, if one is used. In Linux, read/write ; 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 0666 listen.owner = fcgi listen.group = wwwgroup listen.mode = 0666 改完后重启php-fpm即可 注:sock文件存放在/dev/shm目录下,
|
2022-07-18
2022-08-16
2022-11-06
2022-08-18
2022-08-15
请发表评论