Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft Azure Build and deploy PHP app to Azure Web App: Laravel App - Unable to create lockable file #398

Open
AkashPrajapati25 opened this issue Feb 6, 2024 · 4 comments

Comments

@AkashPrajapati25
Copy link

Hello,

We have a Laravel PHP application and we have deployed with the Build and deploy PHP app to Azure Web App workflow.

we have used nginx.

Sometimes we are facing issues related to permissions please find the below detailed error:

Unable to create lockable file: /home/site/wwwroot/storage/framework/cache/data/5a/0f/5a0fce553c194ec423d77dd06617ff2720c4c5c6. Please ensure you have permission to create files in this location.

so the solution is we need to give the permission and ownership using the below command:
chmod -R 775 /home/site/wwwroot/storage
chown -R www-data:www-data /home/site/wwwroot/storage

but after execution, nothing happened, and I was facing the same problem randomly.

Can anyone help with it?

Thanks

@gainlinejono
Copy link

Have you tried adding the commands to the startup command in the app service?

@AkashPrajapati25
Copy link
Author

Yes, I have tried that as well but the same problem occurred.

@berga0d
Copy link

berga0d commented Dec 16, 2024

I think I found the problem.

@gainlinejono
Copy link

Hi all,

The fix i used for this was to put the storage folder on mounted storage, you can do this by specifying a storage location via your environment variables.

For example, our mounted storage was available at /app. So we set our APP_STORAGE=/app/storage.

We did the same for the cache files:

APP_PACKAGES_CACHE=/app/cache/packages.php
APP_ROUTES_CACHE=/app/cache/routes.php
APP_SERVICES_CACHE=/app/cache/services.php

Hope this helps.

Thanks

Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants