laravel.log could not be opened: failed to open stream: Permission denied

Published 10 months ago by dohisev

I just installed Laravel on a centos server and it doesn't work due the permissions. I was wondering how to solve this?

Dry7
Dry7
10 months ago (151,880 XP)

@dohisev try

chmod 777 /storage/logs/laravel.log
dohisev

I was reading that 777 isn't safe so that is why I came here to ask you guys about that... and also reading the docs it says that I need permision on storage folder and bootstrap or something like that.

Snapey
Snapey
10 months ago (998,335 XP)
dohisev

I saw that thread and tried to run the commands but most of them the server says invalid user for chown and invalid group for chgrp.

Talinon

I think CentOS uses 'apache' for group ownership, not 'www-data'

dohisev

chgrp: invalid group: 'apache'

Snapey
Snapey
10 months ago (998,335 XP)

you should not need to change ownership of anything, just concentrate on permissions.

Delete any Log file that already exists in case it is not owned by the webserver

dohisev

The only permission that works is setting 0777 to storage, other than that doesn't work.

pascual

Could also be selinux that makes it impossible to write to the log file.

See https://linuxhint.com/how-to-disable-selinux-on-centos-7/

Please sign in or create an account to participate in this conversation.