无法在学说 php 中找到名为 mysql 的驱动程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1887581/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:11:32  来源:igfitidea点击:

Couldn't locate driver named mysql in doctrine php

phpdoctrineconfiguration-files

提问by Mohit Jain

My application was working perfectly on localhost. But when i uploaded the application on server i got an error. I made a test file to check databse connection, this is the error i am getting. Please hellp me how to fix this..

我的应用程序在本地主机上运行良好。但是当我在服务器上上传应用程序时出现错误。我做了一个测试文件来检查数据库连接,这是我得到的错误。请帮帮我如何解决这个问题..

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

Edit: how to enable my sql drivers..???

编辑:如何启用我的 sql 驱动程序..???

采纳答案by Sarfraz

Make sure that:

确保:

  • mysql extension is enabled on the server where you have uploaded files.
  • you have specified the correct paths.
  • there are no directory permission issues
  • 在您上传文件的服务器上启用了 mysql 扩展。
  • 您已经指定了正确的路径。
  • 没有目录权限问题

回答by user1077220

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

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

回答by krishna

Enable pdo_mysql in the php.ini file

在 php.ini 文件中启用 pdo_mysql