doushang7209 2013-06-12 00:01
浏览 25
已采纳

PDOException无法在Zend Framework 2 + Doctrine上找到驱动程序

I'm trying to install Zend Framework 2 + Doctrine from this manual and have some problem with PDO driver. Doctrine is trying to connect to my MySQL server and then trying to create schema:

./vendor/bin/doctrine-module orm:schema-tool:create

I have this error:

 [PDOException]
 could not find driver

This is my config/autoload/doctrine.local.php:

 return array(   'doctrine' => array(
     'connection' => array(
       'orm_default' => array(
         'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
         'params' => array(
           'driver'   => 'pdo_mysql', 
           'host'     => 'localhost',
           'port'     => '3306',
           'user'     => 'root',
           'password' => 'password',
           'dbname'   => 'blog', 
 )))));

I have PHP 5.3.5 and i have uncommented ;extension=php_pdo_mysql.dll in php.ini, also it wasn't commented. But php -m | grep -i pdo gives me:

PDO

only. I'm know that it should be pdo_mysql too, but i'm trying everything and it isn't appear.

Anyway, PDO driver is works well at my another project on this server, where I'm not using Zend and Doctrine.

  • 写回答

1条回答 默认 最新

  • douyinmian8151 2013-06-12 10:50
    关注

    Ohh yes. I'm just solved a problem. I'm going to this page and thought to find my php.ini files anywhere else perhaps PHP folder - it was one more in "C:\Users\%username%\AppData\Local\VirtualStore\Program Files (x86)\wamp\bin\php\php5.3.5" and there row

    ;extension=php_pdo_mysql.dll
    

    weren't uncomment. I'm uncommented it and it works!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)