php - 权限被拒绝 - 取消链接文件
问题描述
我可以上传文件但不能删除它。
我有一个 nginx、laravel 和 redis 容器。
当我上传我的队列创建文件和文件夹到 /var/www/storage/app/public (laravel 容器)
此文件夹由 docker 卷与主机共享。
当我尝试删除文件和文件夹时,我不能,因为我没有权限......
我试图在 www.conf 中将 php-fpm 用户从 www-data 更改为 root 我试图以 root 用户身份启动 supervisord 队列进程和 fpm
www.conf
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = www-data
group = www-data
supervisord.conf
[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work redis --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=8
priority=10
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/worker.log
解决方案
我找到了解决方案,所以如果你们中的一些人有这种问题。
我最终在我的supervisord conf中更改了Redis的用户以匹配php fpm的用户conf(所以www-data而不是root)
田田 很好用
推荐阅读
- javascript - React js Route 组件导致我的页面变得无响应
- kubernetes - 在 kustomize 叠加层之间共享补丁 - 不识别转换器
- python - Python - Read_csv 读取列的长度
- ruby-on-rails - 如何创建允许我搜索关键字并显示结果的路由(默认值除外)
- excel - 占合并单元格数据的 Excel 公式?
- android - 尝试打开 Sqlite 文件时在 Android Studio 中出现只读文件系统错误
- typescript - 如何使用 `sequelize-typescript` 定义表名?
- git - git diff 忽略移动
- css - 封装时CSS动画不播放
- python - 我无法安装 PyAudio