0

I've created a default livewire component and called it \app\Http\Livewire\kandidaatList.php. In my resources\views\admin\kandidaat\index.blade.php I include it:

<livewire:kandidaatList />

Finally in my resources\views\layouts\head.blade.php I include @livewireStyles in the <head> and in my resources\views\layouts\footer.blade.php include @livewireScripts So everything should be setup correctly.

But if I go to the page I get an error:

ErrorException (E_ERROR) file_put_contents(/var/www/bootstrap/cache/livewire-components.php): failed to open stream: Permission denied (View: /var/www/resources/views/admin/kandidaat/index.blade.php)

Without the livewire include I can open the page.

2 Answers 2

1

This appears to be an issue with your local Laravel development environment more than Livewire. Can you verify, if your bootstrap directory:

  • exists,
  • is writable for Laravel / your web-server user (e.g. nginx). Usually that user is called www-data.

Do you use dockerized development environment such as Sail or Laradock?

Sign up to request clarification or add additional context in comments.

4 Comments

> root@21ed541a9249:/var/www/bootstrap/cache# ls -l livewire-components.php > -rw-r--r-- 1 root root 83 May 20 07:07 livewire-components.php The file does exist and we're using Laradock.
How are you running laradock, as root or regular user?
Myea just blasted the files in the cache folder to 777.
Yeah, one way to do it. I've got 755 with my user (under which I run docker / Laravel Sail too)
0

I was getting this error on my server after deploying an upgrade to Livewire and a new form arrangement that included some components. After the following, I was able to load the page:

sudo rm -rf storage/framework/sessions/*
sudo rm -rf storage/framework/views/*
sudo php artisan cache:clear
sudo php artisan clear-compiled
composer dump-autoload

sudo chown -R www-data:www-data public/uploads/
sudo chown -R www-data:www-data public/temp/
sudo chown -R www-data:www-data storage/uploads
sudo chown -R www-data:www-data storage/tmp
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

Some of those folders were not present on my disk so I made them and ran the chown directives again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.