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

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

问题描述



但是当我使用命令 php app / console doctrine :schema:在命令行中创建,它返回此错误:

  [PDOException] 
找不到驱动

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

我的php.ini文件和phpinfo()清晰显示PDO驱动程序加载。我还在纯PHP中创建了一个脚本,使用PDO连接到我的数据库,它工作正常。没有错误,所以PDO的安装和工作都很好。



PHP和MySQL在我的电脑上运行,使用最新版本的EasyPHP。



原则可能出了什么问题?我应该在哪里看?

解决方案

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



这是一个链接,其中PHP搜索配置文件


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

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[="..."]]

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 and MySQL are running on my computer using the last version of EasyPHP.

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

解决方案

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

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

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

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