Laravel throws 'The bootstrap/cache directory

2020-02-26 02:32发布

I used 'composer update', which updated a few packages. During the updating process the website still functions. However, after it says 'The compiled services file has been removed', the website doesn't load and instead says:

Exception in ProviderRepository.php line 190:
The bootstrap/cache directory must be present and writable.

The weirdest thing is, when I run 'composer update' again, the website starts to work again, until the compiled services file is removed, at which point it throws the same error again. I have already tried the usual things that should be done when this error appears (chown -R everything to the right user/group and chmod all the files and folders 664 and 775 respectively).

I don't know what to do anymore, as the error doesn't seem 'correct'..

10条回答
叼着烟拽天下
2楼-- · 2020-02-26 03:07

Try this after you have run the composer update:

php artisan cache:clear
查看更多
手持菜刀,她持情操
3楼-- · 2020-02-26 03:08

Im using cmder on windows 10 in non elevated mode (Non-Admin). command php artisan cache:clear did not work for me. The folder bootstrap/cache did not exist. I created the folder and removed readonly from both bootstrap and bootstrap/cache folder. Both composer install and composer update are working now.

查看更多
一夜七次
4楼-- · 2020-02-26 03:13

it work for me run in project folder

 sudo chmod -R 777 bootstrap/cache

than run

 composer update

than run

 cache:clear
查看更多
趁早两清
5楼-- · 2020-02-26 03:15
sudo chmod -R ug+rwx storage bootstrap/cache

hopefully, this will solve the problem.

查看更多
成全新的幸福
6楼-- · 2020-02-26 03:17

The best way to resolve this error is : 1. Open your project folder 2. Move to the bootstrap directory 3. Create an empty folder named as "cache" 4. Then do php artisan cache: clear This will work for sure

查看更多
放我归山
7楼-- · 2020-02-26 03:18

On your Laravel directory file, run:

sudo chmod -R 777 bootstrap/cache/
查看更多
登录 后发表回答