为什么 Doctrine 说找不到 PDO 驱动程序? [英] Why does Doctrine say it can't find the PDO driver?

查看:26
本文介绍了为什么 Doctrine 说找不到 PDO 驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天试用了 Symfony 2,并尝试使用 Doctrine.

I tried Symfony 2 today and I tried to play a bit with Doctrine.

但是当我在命令行中使用命令 php app/console dictionary:schema:create 时,它会返回这个错误:

But when I use the command php app/console doctrine:schema:create in the command line, it returns this error:

[PDOException]
could not find driver

doctrine:schema:create [--dump-sql] [--em[="..."]]

我的 php.ini 文件和 phpinfo() 清楚地显示 PDO 驱动程序已加载.我还在纯 PHP 中创建了一个小脚本,以使用 PDO 连接到我的数据库,它运行良好.没有错误,因此 PDO 已安装好并且可以正常工作.

My php.ini file and phpinfo() cleary show that the PDO driver is loaded. I also created a little script in pure PHP to connect to my database using PDO and it worked fine. No error, so PDO is well installed and works.

PHP 和 MySQL 正在我的计算机上使用最新版本的 EasyPHP 运行.

PHP and MySQL are running on my computer using the last version of EasyPHP.

Doctrine 出了什么问题?我现在应该去哪里看?

What could have gone wrong with Doctrine? Where should I look now?

推荐答案

您需要正确配置您的 php cli,以加载与 Web 服务器版本配置加载相同的扩展.

You need to configure correctly your php cli, to load the same extensions that the web server version has configured to load.

这里有一个 链接,关于 PHP 搜索配置文件的位置

Here is a link on where PHP searches for the configuration file

这篇关于为什么 Doctrine 说找不到 PDO 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆