简体   繁体   中英

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.

在 Laravel 项目目录中设置storage目录的写权限:

chmod -R 777 storage

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.

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

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

chown www-data -R storage

Regards dear

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM