laravel deployment failed on heroku

为君一笑 提交于 2021-01-20 09:08:12

问题


Some months ago I succeeded in deploying a Laravel 5.5 application on Heroku.

I tried to do the same today with a Laravel 6.12 application, and I have a lot of problems. I added the .env vars, I added the Procfile. But I have this error:

Did something change between Laravel 5.5 and 6 for deploying to Heroku? How can I get this working?

My post-install-cmd is:

"post-install-cmd": [
            "php artisan cache:clear",
            "php artisan config:cache",
            "chmod -R 777 storage",
            "php artisan passport:keys"
        ]

回答1:


You're using the default file session driver, but this isn't a good fit on Heroku. Its filesystem is ephemeral and local to each dyno.

Try using a different session driver by setting the SESSION_DRIVER environment variable:

heroku config:set SESSION_DRIVER=cookie

cookie is probably simplest, but memcached or redis would work well too if you have either of those set up.

The default session driver didn't change between Laravel 5.5 and 6, but I wouldn't recommend using file with Laravel 5.5 on Heroku either.



来源:https://stackoverflow.com/questions/60354845/laravel-deployment-failed-on-heroku

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!