How to Setup File Permission for Laravel Framework (Best Practise)
Linux server permission best practice for Laravel framework everyone should know.
If you found this article, most probably you have searched the internet for a guide on how to set up Laravel framework file permission properly. You are in luck! But before we begin, below are the most common permission related error faced by Laravel framework users:
- Laravel permission denied
[ErrorException] file_put_contents(/opt/bitnami/apache/htdocs/vendor/composer/installed.php) : failed to open stream: Permission denied
- Works today after fixing the permission, but it happens again the next day due to the daily log created with the wrong permission.
- Cronjob related permission error
- Composer permission error
[RuntimeException] Error Output: PHP Warning: required(../vendor/autoload.php): failed to open stream: no such file or directory
- NPM permission error
npm WARN checkPermissions Missing write access to /opt/bitnami/apache/htdocs/node_modules
- Warning due to running Composer as root
Do not run Composer as root/super user! See https://getcomposer.org/root for details.