I have looked it up online and all solutions were centered about giving 775 permissions to the project directory.
I have set the permissions to my laravel project as 775 per following:
Code: Select all
chmod -R 775 /laravelProject/
chown -R www-data:www-data laravelProject/
Code: Select all
-rwxrwxr-x 1 www-data www-data 3958 Apr 12 2022 README.md
drwxrwxr-x 7 www-data www-data 4096 Apr 12 2022 app
-rwxrwxr-x 1 www-data www-data 1686 Apr 12 2022 artisan
drwxrwxr-x 3 www-data www-data 4096 Apr 12 2022 bootstrap
-rwxrwxr-x 1 www-data www-data 1745 Apr 12 2022 composer.json
-rwxrwxr-x 1 www-data www-data 283912 May 12 22:01 composer.lock
drwxrwxr-x 2 www-data www-data 4096 Apr 12 2022 config
drwxrwxr-x 5 www-data www-data 4096 Apr 12 2022 database
-rwxrwxr-x 1 www-data www-data 473 Apr 12 2022 package.json
-rwxrwxr-x 1 www-data www-data 1202 Apr 12 2022 phpunit.xml
drwxrwxr-x 2 www-data www-data 4096 Apr 12 2022 public
drwxrwxr-x 6 www-data www-data 4096 Apr 12 2022 resources
drwxrwxr-x 2 www-data www-data 4096 Apr 12 2022 routes
-rwxrwxr-x 1 www-data www-data 569 Apr 12 2022 server.php
drwxrwxr-x 5 www-data www-data 4096 Apr 12 2022 storage
drwxrwxr-x 4 www-data www-data 4096 Apr 12 2022 tests
drwxrwxr-x 42 www-data www-data 4096 May 12 22:01 vendor
-rwxrwxr-x 1 www-data www-data 559 Apr 12 2022 webpack.mix.js
This project is throwing this error:
Code: Select all
The stream or file "/home/postroot/laravelProject/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file
This is a production server and I cannot keep the 777 permissions for security reasons. Any idea why I'm getting this error with 775?