不支持的驱动程序mysql亮起

时间:2016-10-24 10:59:20

标签: php mysql

我使用Illuminate和Slim v3。尝试连接到数据库会导致错误:

Type: InvalidArgumentException
Message: Unsupported driver []
File: C:\xampp\htdocs\slim-app\vendor\illuminate\database\Connectors\ConnectionFactory.php
Line: 237

我的配置如下:

$db_host = "127.0.0.1";
$db_name = "db";
$db_user = "user";
$db_pass = "password";


use Illuminate\Database\Capsule\Manager AS Capsule;

$capsule = new Capsule();
$capsule->addConnection([
  'dirver'    => "mysql",
  "host"      => $db_host,
  "database"  => $db_name,
  "username"  => $db_user,
  "password"  => $db_pass,
  "charset"   => "utf8",
  "collation" => "utf8_general_ci",
  "prefix"    => ""
]);

$capsule->bootEloquent();

尝试连接:

$_message = new Message();
$messages = $_message->all();

发生错误。有人可以帮我解决吗?

0 个答案:

没有答案