I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following commands again:
composer self-up
Try the following:
create these folders under storage/framework:
if still it does not work then try
php artisan cache:clear
php artisan config:clear
php artisan view:clear
if get an error of not able to clear cache. Make sure to create a folder data in cache/data
So apparently what happened was when I was duplicating my project the framework folder inside my storage folder was not copied to the new directory, this cause my error.
I solved this problem by adding this line in my index.php
:
$app['config']['view.compiled'] = "storage/framework/cache";
You can edit your readme.md with instructions to install your laravel app in other environment like this:
## Create folders
```
#!terminal
cp .env.example .env && mkdir bootstrap/cache storage storage/framework && cd storage/framework && mkdir sessions views cache
```
## Folder permissions
```
#!terminal
sudo chown :www-data app storage bootstrap -R
sudo chmod 775 app storage bootstrap -R
```
## Install dependencies
```
#!terminal
composer install
```
I also had a similar case after copying a project on a production server. The public folder was accessed by Apache via a symbolic link.
For Apache or the PHP service, the path to the project has not changed, thus they used cached file paths that lead to the old project repository.
Restarting Apache and PHP service resolved the issue.
My 2 cents
Remove everything inside storage and then do this:
> cd storage/
> mkdir -p framework/{sessions,views,cache}
> chmod -R 777 framework
// This last line depends on your user group settings so
// it may not be applicable to you.
> chown -R www-data:www-data framework
Worked for me =)