Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

owen1200003's avatar

Unable to create lockable file:

Hello, I'm getting this error frequently on my production server and am unsure about how I should go about solving it.

My server is running Amazon linux 2

Error:

Unable to create lockable file: /var/www/myproject/storage/framework/cache/data/d0/73/d0737bb3c50deb9580164073239b02bdf3e6bae4. Please ensure you have permission to create files in this location.

My permissions are as follows:

sudo chown -R apache:apache /var/www/myproject
sudo find /var/www/myproject -type d -exec chmod 755 {} +
sudo find /var/www/myproject -type f -exec chmod 644 {} +
sudo chmod -R 777 /var/www/myproject/storage

What am I doing wrong?

0 likes
3 replies
Snapey's avatar

It can be an issue if you login as a different user and run artisan commands. This might create create cache files owned by your user which cannot then be overwritten by user "apache"

try running sudo php artisan cache:clear after manual operations.

5 likes

Please or to participate in this conversation.