Irfi
Irfi

Reputation: 47

PHP Laravel: failed to open stream: Permission denied

I am trying to generate email but getting this error:

fopen(/tmp/4701021fcbc23c3a52dde64ccca28857/body): failed to open stream: Permission denied

Relevant user/group have the permissions but its not working. I used lot of links but none is working.

We are running apache server on linux Ubuntu 14.04.4 LTS and using laravel framework.

Upvotes: 2

Views: 8546

Answers (4)

Riyad Khalifeh
Riyad Khalifeh

Reputation: 177

You can try to write command below to grant your apache user needed privileges:

chown www-data -R storage

Regards dear

Upvotes: 1

You need to access your Laravel project folder so you can run the following command

sudo chmod 777 -R 'your path to project'

Of course you have to replace 'your path to project' with the address of your project folder for example /var/www/html/LaravelNiceProject thats it

Upvotes: -2

Asur
Asur

Reputation: 387

Try running this commands in the console, is very important to execute them from your project root directory, if you don't it won't find the specific laravel commands:

  1. cd your_project_path
  2. php artisan cache:clear
  3. chmod -R 777 app
  4. chmod -R 777 storage
  5. composer dump-autoload

I found a similar problem in the laravel.io/forum with further information.

Upvotes: 1

Alexey Mezenin
Alexey Mezenin

Reputation: 163748

Set up write permissions on storage directory inside your Laravel project directory:

chmod -R 777 storage

Upvotes: 0

Related Questions