不能';在php中找不到名为mysql的驱动程序

不能';在php中找不到名为mysql的驱动程序,php,doctrine,configuration-files,Php,Doctrine,Configuration Files,我的应用程序在本地主机上运行得很好。但当我将应用程序上传到服务器上时,出现了一个错误。我做了一个测试文件来检查数据库连接,这是我得到的错误。请告诉我怎么修理这个 Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib

我的应用程序在本地主机上运行得很好。但当我将应用程序上传到服务器上时,出现了一个错误。我做了一个测试文件来检查数据库连接,这是我得到的错误。请告诉我怎么修理这个

Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't locate driver named mysql' in /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php:492 Stack trace: #0 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect() #1 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php(1008): Doctrine_Connection_Mysql->connect() #2 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Query/Abstract.php(1094): Doctrine_Connection->execute('SELECT u.id AS ...', Array) #3 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Query/Abstract.php(1142): Doctrine_Query_Abstract->_execute(Array) #4 /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/models/Users.php(22): Doctrine_Query_Abstract->execute() #5 /hermes/web05/b1392/moo.fanyer/httpdocs/test.php(8): Users->get_details_username('mohit') #6 {main} thrown in /hermes/web05/b1392/moo.fanyer/httpdocs/doctrine/lib/Doctrine/Connection.php on line 492
编辑:如何启用我的sql驱动程序?

请确保:

  • 已在上载文件的服务器上启用mysql扩展
  • 您已经指定了正确的路径
  • 没有目录权限问题

在php.ini文件中启用pdo_mysql

apt get install php5 mysql---------

您需要询问服务器支持团队您的站点将在哪里运行。看来,原始开发人员可能一直在为pdo依赖项(这就是实际引发此错误的地方)制定解决方案。如果您检查源代码中的条令文件“条令/Connection.php”第480-488行,您会注意到如果PDO加载失败,条令会尝试使用名为“条令适配器”的类,但唯一实现的适配器是Oracle。如果您像我一样,您没有在服务器上安装PDO的选项(出于各种原因),不幸的是“phppdo”没有注册为“extension”,因此检查“extension_loaded”将失败。