<legend id='Mr3WD'><style id='Mr3WD'><dir id='Mr3WD'><q id='Mr3WD'></q></dir></style></legend>
    <i id='Mr3WD'><tr id='Mr3WD'><dt id='Mr3WD'><q id='Mr3WD'><span id='Mr3WD'><b id='Mr3WD'><form id='Mr3WD'><ins id='Mr3WD'></ins><ul id='Mr3WD'></ul><sub id='Mr3WD'></sub></form><legend id='Mr3WD'></legend><bdo id='Mr3WD'><pre id='Mr3WD'><center id='Mr3WD'></center></pre></bdo></b><th id='Mr3WD'></th></span></q></dt></tr></i><div id='Mr3WD'><tfoot id='Mr3WD'></tfoot><dl id='Mr3WD'><fieldset id='Mr3WD'></fieldset></dl></div>
      <bdo id='Mr3WD'></bdo><ul id='Mr3WD'></ul>

    <small id='Mr3WD'></small><noframes id='Mr3WD'>

    1. <tfoot id='Mr3WD'></tfoot>

      CDbConnection 打开数据库连接失败:在 Yii 中找不到驱动程序

      CDbConnection failed to open the DB connection: could not find driver in Yii(CDbConnection 打开数据库连接失败:在 Yii 中找不到驱动程序)

      <small id='bdmK8'></small><noframes id='bdmK8'>

          <tbody id='bdmK8'></tbody>

        • <legend id='bdmK8'><style id='bdmK8'><dir id='bdmK8'><q id='bdmK8'></q></dir></style></legend>
            <bdo id='bdmK8'></bdo><ul id='bdmK8'></ul>

              • <tfoot id='bdmK8'></tfoot>
              • <i id='bdmK8'><tr id='bdmK8'><dt id='bdmK8'><q id='bdmK8'><span id='bdmK8'><b id='bdmK8'><form id='bdmK8'><ins id='bdmK8'></ins><ul id='bdmK8'></ul><sub id='bdmK8'></sub></form><legend id='bdmK8'></legend><bdo id='bdmK8'><pre id='bdmK8'><center id='bdmK8'></center></pre></bdo></b><th id='bdmK8'></th></span></q></dt></tr></i><div id='bdmK8'><tfoot id='bdmK8'></tfoot><dl id='bdmK8'><fieldset id='bdmK8'></fieldset></dl></div>
              • 本文介绍了CDbConnection 打开数据库连接失败:在 Yii 中找不到驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                尝试在 yii 框架中连接 mysql 时,它显示

                while trying to connect with mysql in yii framework it shows

                CDbConnection 无法打开数据库连接:找不到驱动程序"错误

                "CDbConnection failed to open the DB connection: could not find driver " error

                php 代码:

                     'db'=>array(
                        'class' => 'CDbConnection',
                        'connectionString' => 'mysql:host=localhost:3306;dbname=testdrive',
                        'emulatePrepare' => true,
                        'username' => 'root',
                        'password' => 'root',
                        'charset' => 'utf8',
                    ), 
                

                我的 php 驱动程序已经启用,但它显示相同的错误

                my php drivers are already enabled , but it shows the same error

                我正在使用 zend studio,为此使用 zend 服务器

                Im using zend studio, zend server for this

                我该如何解决这个问题?

                how could i fix this?

                推荐答案

                你应该检查的事情

                首先你应该检查 phpinfo() 是否安装了 pdo_drivers.

                First you should check phpinfo() for the pdo_drivers installed.

                如果你使用 IIS 服务器,你应该检查是否安装了 php 扩展.

                if u use IIS server , you should check php extensions installed or not.

                检查 php.ini 是否正确给出了 extensions_dir

                check php.ini for extensions_dir is properly given

                检查 php 中的 ext 文件夹是否包含 pdo_mysql dll

                check you ext folder in php contains pdo_mysql dlls

                有时可能是由于安装了 zend 服务器而出现问题.您应该检查 zend 服务器是否正确使用了 php 扩展

                Some times the problem may occur due to zend server installation .You should check zend server is properly using the php extensions

                之后使用以下函数检查简单的php-mysql连接

                After that check simple php-mysql connection using the following functions

                mysql_connect('localhost:3306','root','root');
                mysql_select_db('testdrive');
                

                如果可行,则使用 Yii、Slim、Zend php-mysql 连接

                If it works then go with Yii, Slim, Zend php-mysql connections

                这篇关于CDbConnection 打开数据库连接失败:在 Yii 中找不到驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                get a # from a url in php(从 php 中的 url 获取 #)
                PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                <small id='e110t'></small><noframes id='e110t'>

                  1. <tfoot id='e110t'></tfoot>
                    <i id='e110t'><tr id='e110t'><dt id='e110t'><q id='e110t'><span id='e110t'><b id='e110t'><form id='e110t'><ins id='e110t'></ins><ul id='e110t'></ul><sub id='e110t'></sub></form><legend id='e110t'></legend><bdo id='e110t'><pre id='e110t'><center id='e110t'></center></pre></bdo></b><th id='e110t'></th></span></q></dt></tr></i><div id='e110t'><tfoot id='e110t'></tfoot><dl id='e110t'><fieldset id='e110t'></fieldset></dl></div>

                      <bdo id='e110t'></bdo><ul id='e110t'></ul>
                        <legend id='e110t'><style id='e110t'><dir id='e110t'><q id='e110t'></q></dir></style></legend>

                            <tbody id='e110t'></tbody>