php-fpm nginx配置文件 处理 Permission denied 错误
来源:互联网 发布:知乎为什么封号 编辑:程序博客网 时间:2024/05/22 02:19
配置php-fpm脚本(php-fpm.conf):
[www] 131 132 ; Per pool prefix 133 ; It only applies on the following directives: 134 ; - 'access.log' 135 ; - 'slowlog' 136 ; - 'listen' (unixsocket) 137 ; - 'chroot' 138 ; - 'chdir' 139 ; - 'php_values' 140 ; - 'php_admin_values' 141 ; When not set, the global prefix (or /usr/local/php) applies instead. 142 ; Note: This directive can also be relative to the global prefix. 143 ; Default Value: none 144 ;prefix = /path/to/pools/$pool 145 146 ; Unix user/group of processes 147 ; Note: The user is mandatory. If the group is not set, the default user's group 148 ; will be used. 149 user = dyh 150 group = dyh 151 152 ; The address on which to accept FastCGI requests. 153 ; Valid syntaxes are: 154 ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 155 ; a specific port; 156 ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 157 ; a specific port; 158 ; 'port' - to listen on a TCP socket to all IPv4 addresses on a 159 ; specific port; 160 ; '[::]:port' - to listen on a TCP socket to all addresses 161 ; (IPv6 and IPv4-mapped) on a specific port; 162 ; '/path/to/unix/socket' - to listen on a unix socket. 163 ; Note: This value is mandatory. 164 listen = /tmp/php-fpm.sock 165 ;listen = 127.0.0.1:9000 166 167 ; Set listen(2) backlog. 168 ; Default Value: 65535 (-1 on FreeBSD and OpenBSD) 169 ;listen.backlog = 65535 170 171 ; Set permissions for unix socket, if one is used. In Linux, read/write 172 ; permissions must be set in order to allow connections from a web server. Many 173 ; BSD-derived systems allow connections regardless of permissions. 174 ; Default Values: user and group are set as the running user 175 ; mode is set to 0660 176 ;listen.owner = www 177 ;listen.group = www 178 listen.mode = 0666
当此处listen配置成unix socket时,在nginx中也需配置成相同的配置
配置为unix socket时需将 listen.mode = 0666 避免在使用nginx时出现 (connect() to unix:/tmp/php-fpm.sock failed (13: Permission denied))错误
nginx中fast cgi配置可用如下:
13 location ~ \.php$ { 14 # fastcgi_pass 127.0.0.1:9000; 15 fastcgi_pass unix:/tmp/php-fpm.sock; 16 fastcgi_index index.php; 17 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 18 include fastcgi_params; 19 }
其中fastcgi_pass 需要与 php-fpm.conf中一致
配置完成后去php目录启动 php-fpm,nginx中启动nginx.
阅读全文
0 0
- php-fpm nginx配置文件 处理 Permission denied 错误
- Nginx的Permission denied错误
- nginx 13: Permission denied 错误
- php-fpm Permission denied访问不了问题
- nginx 502错误 failed (13: Permission denied)
- nginx报403错误(13:Permission denied)
- nginx php-fpm 输出php错误日志
- nginx php-fpm 输出php错误日志
- nginx php-fpm 输出php错误日志
- nginx php-fpm 输出php错误日志
- nginx php-fpm 输出php错误日志
- nginx+php-fpm访问报错,显示access denied
- nginx php-fpm file not found错误
- nginx php fpm 如何显示错误日志
- 解决nginx+php-fpm间歇性502错误
- nginx php-fpm file not found错误
- Nginx Permission denied
- nginx permission denied
- AndroidStudio安装GsonFormat插件并快速创建JavaBean
- Linux脚本基础学习二
- hash索引跟B树索引的区别
- Retrofit中如何正确的使用https?
- 腾讯云互动直播分享屏幕小结
- php-fpm nginx配置文件 处理 Permission denied 错误
- 图像基本变换---图像二值化(包含OSTU/迭代法/统计法/双峰法/P分位法/最大熵法)
- Maximum Subarray
- 使用 textview实现文字的阴影效果,浮雕效果
- Muduo网络库源码分析(三)线程间使用eventfd通信和EventLoop::runInLoop系列函数
- Let's Encrypt证书使用
- ORA-01427: 单行子查询返回多个行
- Swagger2 (1)到此一游集成spring boot
- redhat EL6.5下的mysql5.7并行复制原理及基本配置