我尝试使用此代码在Freebsd,php 56上连接我的数据库:
<?php
$host = "x";
$user = "x";
$password = "x";
try {
$account = new PDO("mysql:host=$host;dbname=account", $user, $password);
} catch(PDOException $e) {
die($e);
}
try {
$player = new PDO("mysql:host=$host;dbname=player", $user, $password);
} catch(PDOException $e) {
die($e);
}
我收到此错误
exception 'PDOException' with message 'could not find driver' in /usr/local/www/apache24/data/config/db.php:7
Stack trace:
#0 /usr/local/www/apache24/data/config/db.php(7): PDO->__construct('mysql:host=x', 'x', 'x')
#1 /usr/local/www/apache24/data/index.php(3): include('/usr/local/www/...')
#2 {main}
所以我知道我应该安装驱动程序。 我没有在google上为freebsd找到任何有用的东西。你能救我吗?