问下为啥我的php会Access denied.,我php进程是www的,nginx也是www,文件用户也是www的

情况是这样的我安装了nginx,php7.4,用remi安装的
然后我配置了nginx user www;
配置的listen 是127.0.0.1:9000;
nginx 对php转发

 fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_param  PATH_INFO  $fastcgi_path_info;
fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
include fastcgi_params;

然后我配置php-fpm.conf user 也是www,
然后我ps -ef |grep php

root      19146      1  0 12:05 ?        00:00:00 php-fpm: master process (/etc/opt/remi/php74/php-fpm.conf)
www       19147  19146  0 12:05 ?        00:00:00 php-fpm: pool www
www       19148  19146  0 12:05 ?        00:00:00 php-fpm: pool www
www       19149  19146  0 12:05 ?        00:00:00 php-fpm: pool www
www       19150  19146  0 12:05 ?        00:00:00 php-fpm: pool www
www       19151  19146  0 12:05 ?        00:00:00 php-fpm: pool www
www       19152  19146  0 12:05 ?        00:00:00 php-fpm: pool www

然后我ps -ef |grep nginx

root      17416      1  0 11:45 ?        00:00:00 nginx: master process nginx -c /etc/nginx/nginx.conf
www       18489  17416  0 11:58 ?        00:00:00 nginx: worker process
www       18490  17416  0 11:58 ?        00:00:00 nginx: worker process
www       18491  17416  0 11:58 ?        00:00:00 nginx: worker process
www       18492  17416  0 11:58 ?        00:00:00 nginx: worker process
www       18493  17416  0 11:58 ?        00:00:00 nginx: worker process
www       18494  17416  0 11:58 ?        00:00:00 nginx: worker process

我代码也是www用户的,不知为啥给我报Access denied.错误

nginx报这个错误,18500#18500: *61 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0Unable to open primary script: /home/www/test/public/index.php (Permission denied)" while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /device/admin/uploadData HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "10.23.23.12"
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
最佳答案

我后来搜了下,看到这个博客blog.csdn.net/weixin_34075268/arti... ,解决了我的问题,用的SELinux状态(Yes)将selinux关闭即可

3个月前 评论
讨论数量: 2

检查文件夹权限

3个月前 评论

我后来搜了下,看到这个博客blog.csdn.net/weixin_34075268/arti... ,解决了我的问题,用的SELinux状态(Yes)将selinux关闭即可

3个月前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!