Today, during the deployment of an existing Laravel application on LAMP environment, I found the following error on the screen.
After more debugging and Google it, I found that the storage/framework directory is missing from deployment. Because the .gitignore file has an entry of storage/framework directory to prevent them from adding code to the git repository and this is normal.
Solution:
To solve this issue, you have to create “framework” folder inside the storage directory. Inside the “framework” directory create 3 more directories as “sessions, views and cache” as below:
/path/to/laravel/storage/framework/
- sessions
- views
- cache
Using the Linux terminal, use the following commands to create the directory structure.
cd storage/ mkdir -p framework/{session,views,cache}
You also need to set permissions to allow Laravel to write data in this directory.
chmod -R 777 framework chown -R www-data:www-data framework
Leave a Reply