Php 在lumen 5.6中找不到postgresql数据库的驱动程序
我在lumen 5.6中找到postgre数据库的Php 在lumen 5.6中找不到postgresql数据库的驱动程序,php,laravel,lumen,Php,Laravel,Lumen,我在lumen 5.6中找到postgre数据库的找不到驱动程序。但是,当我在我的核心php中尝试这一点时,它是有效的 这是我的postgre数据库的.env配置数据:- DB_CONNECTION=pgsql DB_HOST=localhost DB_PORT=5432 DB_DATABASE=test DB_USERNAME=xxxx DB_PASSWORD=xxxxxx 这是我的bootstrap.php <?php require_onc
找不到驱动程序。但是,当我在我的核心php中尝试这一点时,它是有效的
这是我的postgre数据库的.env
配置数据:-
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=test
DB_USERNAME=xxxx
DB_PASSWORD=xxxxxx
这是我的bootstrap.php
<?php
require_once __DIR__.'/../vendor/autoload.php';
try {
(new Dotenv\Dotenv(__DIR__.'/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
//
}
$app = new Laravel\Lumen\Application(
realpath(__DIR__.'/../')
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->router->group([
'namespace' => 'App\Http\Controllers',
], function ($router) {
require __DIR__.'/../routes/web.php';
});
return $app;
请向我们展示您的bootstrap/app.php
文件。@parthu_panther添加了app.php文件contentya,因为laravel有配置文件,其中声明了驱动程序配置,但在lumen中,您需要先启用它。@parthu_panther我对laravel和lumen都是新手。因此,我可以告诉我或提供一些关于如何启用驱动程序配置的链接吗?将DB_HOST=localhost
更改为DB_HOST=127.0.0.1
,然后查看它是否连接。