php - Laravel log write permission denied -
i facing permission issue log writing in laravel app. have daily logs new log file gets created every day. project folder ownership set www-data
. , logs generated www-data
permission. logs created root
user , if somewhere try write in log permission denied , application crashes.
-rw-r--r-- 1 www-data www-data 77016 sep 12 05:00 laravel-2017-09-11.log -rw-r--r-- 1 root root 1240 sep 12 10:30 laravel-2017-09-12.log
for example, yesterday's log created www-data
today it's under root
. getting crashes everytime. if delete log or change permission 777
solves while until pops again. cannot replicate issue , don't know why logs being created under root user. appriciated. thank you.
you can run cron www-data user.
ex: * * * * * www-data php /path/to/artisan schedule:run >> /dev/null 2>&1
Comments
Post a Comment