How to fix Error: laravel.log could not be opened?

FRR :

I'm pretty new at laravel, in fact and I'm trying to create my very first project. for some reason I keep getting this error (I haven't even started coding yet)

Error in exception handler: The stream or file "/var/www/laravel/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/laravel/bootstrap/compiled.php:8423

I've read this has something to do with permissions but chmod -R 775 storage didn't help at all.

Permissions

FRR :

To fix this issue, you need to change the ownership of the directory to the unix user that the webserver uses.

  1. Get out of the VM
  2. Using the console, go to your synced folder (vagrant)
  3. sudo chown -R $USER:www-data storage
  4. chmod -R 775 storage

Even though I created the project within the VM using the VM user, the folder belonged to the user in the real computer; so, when trying to

Now it's working.

Thanks to all those that helped me figure this thing out

EDIT:

Actually, it still wasn't working, it still gave me a "permission denied" problem.

Here's what I did, I modified my Vagrantfile like this:

config.vm.synced_folder "./app","/var/www/", create:true,
:owner => "vagrant",
:group => "www-data",
:mount_options => ["dmode=775","fmode=664"]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to fix Error: laravel.log could not be opened Permission denied?

I got message for error_log file "The stream or file ".../laravel.log" could not be opened: failed to open stream: Permission denied"

How can i fix "error CS0009: Metadata file "System.Xml.dll' could not be opened -- Image is too small"?

error file could not be opened when upload image laravel

How to fix cpanel log in error?

xampp ubuntu laravel The stream or file "/storage/logs/laravel log" could not be opened: failed to open stream: Permission denied

Laravel The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

How to fix 'Could not parse for environment production' error?

How to fix this Purescript error: Could not match {...} with (...)?

How To Fix "Could Not Find A Part Of The Path" Error

How to fix "could not be scrolled into view" error In Selenium?

How to fix "Could not find method" error?

The stream or file "/app/storage/logs/laravel.log" could not be opened: failed to open stream:Permission denied

laravel centOS 8 "log file could not be opened in append mode: failed to open stream: Permission denied”

The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

The stream or file "...\storage\logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied

laravel-2019-06-24.log" could not be opened: failed to open stream: Permission denied

"storage/logs/laravel-2019-11-22.log" could not be opened: failed to open stream: Permission denied

How do I fix "Your profile could not be opened correctly" in Chrome on a Mac?

How to fix the error log not appearing at once?

How to fix Laravel Group by error in Laravel 5.6

How to fix cur error: could not resolve host error

Laravel & Docker: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

How to fix log4j yaml config issue "main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender..."

how to fix "Object of class stdClass could not be converted to string" in laravel?

How to fix android build error - Could not create the Java Virtual Machine

How to fix "Could not load file or assembly System.Core" error?

How to fix Xcode "DTAssetProviderService could not start.." error?

How to fix install error "Could not find a version that satisfies the requirement pyplot"?