“Unable to create lockable file: /var/www/html/storage/framework/cache/data/xx/xx/xxxxx. Please ensure you have permission to create files in this location.”
laravel
php artisan optimize:clear
Hello Stack Overflow community,
I’ve encountered a perplexing issue with my Laravel API in a production environment, and I’m seeking guidance to resolve it. Some users are reporting the following error related to cache file permissions:
Please run blow commands:
php artisan optimize:clear
give your storage 775 by the following command in ur server terminal using below command:
sudo chmod -R 775 /var/www/html/storage
make sure to give the folder the right permssion of your web server using below command:
sudo chown -R www-data:www-data /var/www/html/storage
Don’t forget to restart it using below command:
sudo service apache2 restart