将项目部署至 Heroku,报错数据库拒绝连接?
推送到heroku,打开网页链接提示如下错误:
提示错误的页面也与本地不同,是laravel版本不一样还是报错的扩展包版本不一样?
说我数据库连接被拒绝?然后我运行迁移文件:
vagrant@homestead:~/Code/larabbs$ heroku run php artisan migrate
▸ heroku-cli: update available from 6.13.19 to 6.99.0-ec9edad
Running php artisan migrate on ⬢ jianong-larabbs... up, run.2841 (Free)
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? (yes/no) [no]:
> yes
In Connection.php line 664:
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations)
In Connector.php line 67:
SQLSTATE[HY000] [2002] Connection refused
vagrant@homestead:~/Code/larabbs$
再次提醒我拒绝连接??
反正问题应该就是数据库的问题了,访问一些不需要进行数据库操作的静态页面则不会报错:
还有一些问题:部署到heroku后没有.env文件的么?dubug也是设置的 config/app.php 中的 APP_DUBUG 默认值为true
推荐文章: