首页 > 解决方案 > 权限被拒绝 - 取消链接文件

问题描述

我可以上传文件但不能删除它。

我有一个 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

标签: phpdockernginxsupervisord

解决方案


我找到了解决方案,所以如果你们中的一些人有这种问题。

我最终在我的supervisord conf中更改了Redis的用户以匹配php fpm的用户conf(所以www-data而不是root)

田田 很好用


推荐阅读