laravel在heroku上部署失败

时间:2020-02-22 17:31:18

标签: laravel heroku

几个月前,我成功地在Heroku上部署了Laravel 5.5应用程序。

我今天尝试使用Laravel 6.12应用程序执行相同的操作,但是我有很多问题。我添加了.env变量,我添加了Procfile。但是我有这个错误:

enter image description here

Laravel 5.5和6之间在部署到Heroku方面是否有所改变?我该如何工作?

我的post-install-cmd是:

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

1 个答案:

答案 0 :(得分:2)

您使用的是默认的file会话驱动程序,但这不适用于Heroku。 Its filesystem is ephemeral and local to each dyno

通过设置SESSION_DRIVER环境变量来

Try using a different session driver

heroku config:set SESSION_DRIVER=cookie

cookie可能是最简单的,但是memcachedredis也可以很好地工作。

Laravel 5.5和6之间的默认会话驱动程序没有变化,但我也不建议在Heroku上将file与Laravel 5.5一起使用。

相关问题