gpt4 book ai didi

php - PDOException “could not find driver”

转载 作者:IT老高 更新时间:2023-10-28 11:38:24 26 4
gpt4 key购买 nike

我刚刚使用 Apache、MySQL 和 PHP 安装了 Debian Lenny,我收到 PDOException 找不到驱动程序

这是它所指的特定代码行:

$dbh = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS)

DB_HOSTDB_NAMEDB_USERDB_PASS 是我定义的常量。它在生产服务器(以及我之前的 Ubuntu 服务器设置)上运行良好。

这与我的 PHP 安装有关吗?

搜索互联网没有帮助,我得到的只是专家交流和示例,但没有解决方案。

最佳答案

您需要有一个名为 pdo_mysql 的模块。在phpinfo()中寻找关注,

pdo_mysql

PDO Driver for MySQL, client library version => 5.1.44

关于php - PDOException “could not find driver”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2852748/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com