咨询下,项目目录权限的问题

本月刚刚接触并使用的1panel,安装的是php7.4版本的,在容器内挂载了一个thinkphp的queue进程,里面有LOG写入的部分,每次第二天或者隔一阵子就会提示写入权限不足的情况,我目前每次都是在容器外对目录权限进行修改为777,并且在每日的0点挂载了一个计划任务初始权限为777,但是还是会遇到写入权限不足的情况,应该怎么处理

你的目录用户和用户组是 1000:1000 吗

image
我在运行环境里面,点更多守护进程添加的queue监听

那应该没问题的 是不是你的 logo 权限不对

没有特殊处理什么,只是在业务里面使用了 thinkphp 的 Log 记录日志

贴点日志看看吧

目前全删除了,里面日志队列一直重复在处理日志过多,我晚上看下会不会复现

[think\exception\ErrorException]
error_log(/www/sites/site/index/runtime/log/202601/15_cli.log): failed to open stream: Permission denied

PHP Fatal error: Uncaught think\exception\ErrorException: error_log(/www/sites/site/index/runtime/log/202601/15_cli.log): failed to open stream: Permission denied in /www/sites/site/index/thinkphp/library/think/log/driver/File.php:171
Stack trace:
#0 [internal function]: think\Error::appError()
#1 /www/sites/site/index/thinkphp/library/think/log/driver/File.php(171): error_log()
#2 /www/sites/site/index/thinkphp/library/think/log/driver/File.php(75): think\log\driver\File->write()
#3 /www/sites/site/index/thinkphp/library/think/Log.php(179): think\log\driver\File->save()
#4 /www/sites/site/index/thinkphp/library/think/Error.php(93): think\Log::save()
#5 [internal function]: think\Error::appShutdown()
#6 {main}
thrown in /www/sites/site/index/thinkphp/library/think/log/driver/File.php on line 171
image
权限还是一样,但是执行的时候又提示这个了

你进入目录 截图看一下哪个文件/文件夹权限有问题

线上的我已经手动重新设置了权限,现在没法截图出来;
执行文件是:www/sites/site/index/application/common/library/job/LogJob.php
面板是安装在opt目录上面,安装的时候都是回车直接安装的
框架就是fastadmin,目前是这样设置的,我在面板的网站=>运行环境,容器是php7.4,点击的更多,进程守护添加的执行命令行

/www/sites/site/index/thinkphp/library/think/log/driver/File.php:171
这个代码操作的文件是哪个?

这个是框架内的文件,类似于写入网站的日志,就是把日志写入到 runtime/log/202601/15_cli.log 这个文件

你的 queue 是用什么用户启动的

好像没有用指定的用户,我是直接执行的;

必须指定 你看一下配置


www-data ,都是默认的,我只设置了启动命令

写出来的日志权限是什么?

我目前设置的777,按照框架文档来说基础应该是755

command=sh -c “umask 0002 && php think queue:listen --queue log”
directory=/www/sites/site/index
user=www-data
autostart=true
autorestart=true
AI让我改成这样,可以修复这个问题吗