0

I did an installation of laravel, and copied the files to a xampp hosted folder on the same machine. When I try to visit my index.php file however, I'm getting the following error:

Error in exception handler: The stream or file "/Applications/XAMPP/xamppfiles/htdocs/TestManagement/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /Applications/XAMPP/xamppfiles/htdocs/TestManagement/bootstrap/compiled.php:8969 

I'm always a bit hesitant about changing permissions, as I've done some pretty bad chmodding before. Was wondering if there was a rule of thumb or expected behavior for this. Should this be 777 or 755?

2

2 Answers 2

2

The Laravel and Monolog documentation appear to contain no reference to the 'right' permissions. You can make it work with restrictive permissions, but be aware of all of the users that need access:

  • the web server user
  • cron user (if you run artisan commands via cron)
  • anyone who manually runs artisan commands.

They will each need read/write permissions to the log files.

Sign up to request clarification or add additional context in comments.

Comments

0

Always use 777 on app/storage folder

2 Comments

As a general rule of thumb, I totally agree with this but having correct users in correct groups and assigning those groups with relevant permissions would be a better approach.
Please have in mind that chmod 777 is considered as bad practice.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.