I'm create a laravel project and upload it into shared hosting server (cpanel). That server already have some my other running project also with different laravel versions. After upload use above mention version project itkeep getting this error
Unable to create lockable file: /home/xxxxxx/domain_name/storage
/framework/cache/data/a0/52/a052c710b70b9dc1cc66e7710af44867198f74e1. Please ensure you
have permission to create files in this location.
If this error occurred all other laravel project on that server getting same error. Also can't going to change php version page on cpanel provide. That page also getting error message. I'm tired with solution on this post given solution. But it only works for limited time. If I clear the cache today it works without error but next day it getting this error again. Is their any permanent solution for this?
@Prabodhana@tisuchi I use Laravel 8.x too but PHP 7.4... I was wondering if there are other things to look out for, like the php.ini for file-related configurations. I'm experiencing the same issue too. It works for most of the requests, but at some point, some requests causes errors in my logs like this one:
file_put_contents(/home/backridepal/public_html/storage/framework/cache/datas/19/79/197954b48352a99af945d2604c9b190fb3583ae9): failed to open stream: No such file or directory {"userId":1773,"exception":"[object] (ErrorException(code: 0): file_put_contents(/home/backridepal/public_html/storage/framework/cache/datas/19/79/197954b48352a99af945d2604c9b190fb3583ae9): failed to open stream: No such file or directory at /home/backridepal/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:187)
I inspected my storage/framework/cache/datas folder, there are other files which are owned by root while others are normally owned by backridepal (our web user). Why is this happening? How do I make sure that all cache files created are always owned by backridepal? I think this is what's causing the "Unable to create lockable file" and file_put_contents(/home/backridepal/public_html/storage/framework/cache/datas/19/b8/19b8d39dc21197ef4f2f04faec3709e58764c278): failed to open stream: No such file or directory {"userId":7035,"exception":"[object] (ErrorException(code: 0): file_put_contents(/home/backridepal/public_html/storage/framework/cache/datas/19/b8/19b8d39dc21197ef4f2f04faec3709e58764c278): failed to open stream: No such file or directory at /home/backridepal/public_html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:187)