'Unable to create lockable file - Laravel 8 & PHP 8
I'm stuck in a Laravel project, I've been using laravel a lot of years and never happened this.
I'm using Vagrant (as always) and only happens this with PHP 8, with other projects with php 7.X doesn't happen.
The USER and GROUP permisions are OK as always. I Ran chmod -R 777 storage
and bootstrap/cache a lot of times.
I ran all cache:clear.
I don't know why it's happening this.
Anyone had problems with Laravel and PHP 8?
Thanks!
Solution 1:[1]
Please use the following commands:
- Clear your project's cache
cd /home/vagrant/code/project_folder_name
sudo php artisan cache:clear
- Give your folders proper permission
sudo chmod 775 /home/vagrant/code/project_folder_name
sudo chown -R vagrant:vagrant /home/vagrant/code/project_folder_name
Hopefully, it will solve your issue.
Solution 2:[2]
Can you please try with the given permission, as it should be on web server group www-data level as well?
Also, adding a link for your reference.
https://linuxhint.com/how-to-set-up-file-permissions-for-laravel/
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Solution 3:[3]
I resolved it by providing owner permission to apache user:
chown -R apache:apache storage/framework
Solution 4:[4]
I just ran php artisan cache:clear and it worked
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | udoyhasan |
Solution 2 | Jijo Alexander |
Solution 3 | Abdullah Basit |
Solution 4 | AKEEM AKEEM |