My Laravel 7 app deploys to Heroku without any errors during deployment. However, upon opening the app in the browser, I received the following Error Exception:
file_put_contents(/tmp/build_d3cb80e3d9d066f9486ad70783e0f0ba/storage/framework/sessions/BbnXCLFvgRPnTFSdQFvBYlmDhTfaIaesjbCsdVb8): failed to open stream: No such file or directory
I then ran artisan config:clear and redeployed (something which seemed to fix the problem for most others in Laravel 5) but no change.
I then went into config/session and changed 'expire_on_close' to true. I also changed lottery from [2,100] to [100,100] so that all sessions in storage would be swept on each request instead of only in 2% of cases.
I ran artisan config:clear again before redeploying. The Error Exception has now changed to the following:
Symfony\Component\Finder\Exception\DirectoryNotFoundException
The "/tmp/build_d5d0270f_/storage/framework/sessions" directory does not exist.
Note: I am deploying through Github.
I have successfully ran the following commands on the Heroku console:
chmod -R 770 bootstrap/cache
chmod -R 770 storage