Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mani95lisa's avatar

Log permission problem

I use cap to deploy and chmod storage folder to 777, and use cron schedule to run some tasks.

If the schedule task run, then create a root root log file, that caused permission error when nginx write any log into that log file, because nginx belongs to www-data.

I'm not clear what's the right way to deploy, any idea?

Thanks!

storage folder:

4 drwxrwxrwx 4 root root 4096 Feb  6 22:13 storage

log files:

0 -rwxrwxrwx 1 root www-data    0 Feb  9 23:27 laravel-2016-02-07.log
4 -rwxrwxrwx 1 root root      116 Feb  8 22:00 laravel-2016-02-08.log
0 -rwxrwxrwx 1 root www-data    0 Feb  9 23:27 laravel-2016-02-09.log
4 -rwxrwxrwx 1 root root     2552 Feb 13 12:05 laravel-2016-02-13.log
0 likes
2 replies
ohffs's avatar

What is your scheduled task doing? And are you running it via laravel or doing cron jobs directly? Edit: never mind then :-)

Please or to participate in this conversation.