请问一个 Lumen 的问题,我在.env 中配置了 DB 的配置,但是依然报出找不到数据库配信信息。

2015-09-03 00:21:33 +08:00
 xiaoyu9965

我将测试环境的代码迁移到线上环境上来,然后就手动的配置下.env 。但是饱了这个莫名秒的错误。
我的.env 配置如下:
APP_ENV=local
APP_DEBUG=true
APP_KEY=3enKXjXbYW4O3OklteV4El31KXs0avK8

APP_TIMEZONE=PRC

APP_LOCALE=en
APP_FALLBACK_LOCALE=en

DB_CONNECTION=mysql
DB_HOST=10.137.208.14
DB_PORT=3306
DB_DATABASE=mkacall
DB_USERNAME=admin
DB_PASSWORD=cLuj0Ye9bl
DB_TIMEZONE=+08:00

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database

MAIL_DRIVER=smtp

MAIL_HOST=mailtrap.io

MAIL_PORT=2525

MAIL_USERNAME=null

MAIL_PASSWORD=null

MAIL_FROM_ADDRESS=null

MAIL_FROM_NAME=null

错误如下:
InvalidArgumentException in DatabaseManager.php line 238:
Database [] not configured.

in DatabaseManager.php line 238
at DatabaseManager->getConfig (null ) in DatabaseManager.php line 157
at DatabaseManager->makeConnection (null ) in DatabaseManager.php line 67
at DatabaseManager->connection (null ) in Model.php line 3152
at Model::resolveConnection (null ) in Model.php line 3118
at Model->getConnection () in Model.php line 1866
at Model->newBaseQueryBuilder () in Model.php line 1809
at Model->newQueryWithoutScopes () in Model.php line 1783
at Model->newQuery () in Model.php line 3364
at Model->call ('whereRaw', array (' email = ? AND password = ? ', array ('251400931@qq.com', 'e10adc3949ba59abbe56e057f20f883e')))
at AdminUser->whereRaw (' email = ? AND password = ? ', array ('251400931@qq.com', 'e10adc3949ba59abbe56e057f20f883e'))
at call_user_func_array (array (object (AdminUser ), 'whereRaw'), array (' email = ? AND password = ? ', array ('251400931@qq.com', 'e10adc3949ba59abbe56e057f20f883e'))) in Model.php line 3380
at Model::
callStatic ('whereRaw', array (' email = ? AND password = ? ', array ('251400931@qq.com', 'e10adc3949ba59abbe56e057f20f883e'))) in IndexController.php line 30
at AdminUser::whereRaw (' email = ? AND password = ? ', array ('251400931@qq.com', 'e10adc3949ba59abbe56e057f20f883e')) in IndexController.php line 30
at IndexController->signin ()
at call_user_func_array (array (object (IndexController ), 'signin'), array ()) in Container.php line 502
at Container->call (array (object (IndexController ), 'signin'), array ()) in Application.php line 1348
at Application->callControllerCallable (array (object (IndexController ), 'signin'), array ()) in Application.php line 1313
at Application->callLumenController (object (IndexController ), 'signin', array (true, array ('uses' => 'App\Http\Controllers\Admin\IndexController@signin'), array ())) in Application.php line 1284
at Application->callControllerAction (array (true, array ('uses' => 'App\Http\Controllers\Admin\IndexController@signin'), array ())) in Application.php line 1252



5811 次点击
所在节点    PHP
3 条回复
isCyan
2015-09-03 00:39:10 +08:00
这样直接贴上来泄露多少隐私信息啊…
holystrike
2015-09-03 01:08:23 +08:00
bootstrap/app.php 把 loadenv 那句话取消注释
xiaoyu9965
2015-09-03 01:15:21 +08:00
@holystrike 那句话已经注释掉了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/217983

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX