讨论数量:
ls -l storages
ls -l storages/logs
ps aux | grep nginx
ps aux | grep php
crontab -u www -l # 如果有的话
# 查看这几个用户是不是一样
什么情况下会写日志?
- fpm执行的时候
- 定时任务执行的时候
没有权限排除:第一项目目录执行权限是否为fpm的执行者(fpm执行用户在php-fpm.conf里 user= 可以查到),定时任务执行者是谁?是root还是跟fpm的一样?如果不是统一执行者,比如下面的
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
#把你的 root 下的 crontab
crontab -u root -l
# 挪到 www-data下
crontab -u www-data -e
# 然后重新
chmod ...
chown ...
#如果你想手动跑 请 执行
su www-data
# 而不是在root 下跑 要不还得重新 chmod chown
BT定时任务使用下边的命令:
su -c "cd /www/wwwroot/blog && php artisan schedule:run >> /dev/null 2>&1" -s /bin/sh www
推荐文章: