Skip to content
Advertisement

Laravel: while hosting xampp on localhost in mac getting an error UnexpectedValueException

I am just starting with laravel, when I localhost it in xampp(localhost:8080/app/public) in mac [where app is a file created when I created] it shows an error

`UnexpectedValueException
The stream or file "/opt/lampp/htdocs/app/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied`

Please help me with this.

Advertisement

Answer

It looks that laravel doesn’t have permissions to create logs so come to the root directory of the project and run this command from your terminal

sudo chmod -R 775 .

in your case, your project is in this path /opt/lampp/htdocs/app so move to it first then change permissions like this

$ cd /opt/lampp/htdocs/app
$ sudo chmod -R 775 . 
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement