检查了php.ini文件"extension = php_pdo_mysql.dll";启用但仍然错误 [英] checked the php.ini file "extension=php_pdo_mysql.dll" enabled but still error

查看:558
本文介绍了检查了php.ini文件"extension = php_pdo_mysql.dll";启用但仍然错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了启用扩展的php.ini文件:

I've checked the php.ini file the extensions are enabled:

extension=php_pdf.dll
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll

但是当我尝试打开页面时仍然显示错误

but still when i try to open the page it gives the error

500 |内部服务器错误| PropelException 无法打开PDO连接[包裹:找不到驱动程序]

500 | Internal Server Error | PropelException Unable to open PDO connection [wrapped: could not find driver]

我现在需要做什么?消除此错误

what do i need to do now? to eliminate this error

谢谢

推荐答案

  • 找出您实际需要的PDO驱动程序(MySQL,MS SQL ...?)

    • Find out which PDO driver you actually need (MySQL, MS SQL...?)

      通过自己实例化PDO进行测试,以避免发生其他错误:

      Test by instantiating PDO yourself, to avoid errors elsewhere:

      $db = new PDO('mysql:host=127.0.0.1;dbname=testdb', 'username', 'password');

      如果您仍然得到找不到驱动程序",现在可以确定自己确实缺少它:)

      If you still get "could not find driver", now you can be sure that you're really missing it :)

      如何安装(如果您还没有安装的话)在很大程度上取决于您的系统.例如,在Debian Linux上,您需要执行apt-get install php5-mysql,它会安装mysqlmysqlipdo_mysql扩展名.

      How to install it, if you don't have it already, depends a lot on your system. On Debian Linux, for example, you need to do apt-get install php5-mysql, which installs mysql, mysqli and pdo_mysql extensions.

      安装后,请确保已在php.ini中启用它.确保您正在编辑正确文件-网络服务器使用的文件.

      After you install it, ensure that it's enabled in php.ini. make sure that you're editing the correct file - the one that is used by your webserver.

      然后,要验证扩展程序是否正确加载,请执行以下任一操作:

      Afterwards, to verify the extension was loaded correctly, either:

      • 创建一个执行phpinfo()的脚本.您应该看到一个 PDO 部分,其中包含键 PDO驱动程序和一个值,例如"mysql, pgsql"或

      • create a script which executes phpinfo(). You should see a PDO section with a key PDO drivers and a value such as "mysql, pgsql", or

      从命令行运行php -m,您应该会看到例如pdo_mysql.

      run php -m from the command line and you should see pdo_mysql for example.

      这篇关于检查了php.ini文件"extension = php_pdo_mysql.dll";启用但仍然错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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