CDbConnection无法打开数据库连接

我找到了很多关于这个问题的答案,它也在stackoverflow中被问到,但答案并没有解决我的问题 问题。</ p>

他们在论坛和Q / A网站上告诉他们将PHP连接到MS SQL Server的方法,我使用相同但我在YII Framework中收到以下错误< / p>


CDbConnection无法打开数据库连接:SQLSTATE [IMSSP]:此扩展名需要Microsoft SQL Server 2012 Native Client ODBC
驱动程序才能与SQL Server通信。 访问以下URL以
下载
x86的Microsoft SQL Server 2012 Native Client ODBC驱动程序: http://go.microsoft.com/fwlink/?LinkId=163712 </ p>
</ blockquote>


  • 我安装了Microsoft SQL Server 2012 来自上面给定链接的Native Client ODBC驱动程序。</ li>
  • 我在php.ini中包含以下行</ li>
    </ ul>


    extension = php_sqlsrv_54_ts.dll </ p>

    extension = php_pdo_sqlsrv_54_ts.dll </ p>
    </ blockquote>


    • 我已保存上述dll 在php / ext文件夹中。</ li>
      </ ul>

      但我仍然收到此错误。
      此外,我还在Windows的管理工具中的ODBC数据源管理器中创建了一个系统DSN 。</ p>

      但我没有找到问题的解决方案。</ p>

      请帮我解决这个问题。</ p>

      谢谢!</ p>
      </ div>

展开原文

原文

I found lots of answers about this question and it is asked in stackoverflow as well, but that answers do not solve my problem.

The method they are telling in the forums and Q/A websites to connect PHP with MS SQL Server, I am using the same but I am getting the following error in YII Framework

CDbConnection failed to open the DB connection: SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712

  • I have installed the Microsoft SQL Server 2012 Native Client ODBC driver from the given link above.
  • I have included the following lines in php.ini

extension=php_sqlsrv_54_ts.dll

extension=php_pdo_sqlsrv_54_ts.dll

  • I have save the above dlls in php/ext folder.

But still I am getting this error. Moreover I have also made a System DSN in ODBC Data Source Administrator in Administrative Tools in Windows.

But I didn't found the solution of my problem.

Please help me out to solve this problem.

Thanks!

dongxiao9583
dongxiao9583 我降级了php版本,它与php5.3一起工作正常
接近 7 年之前 回复
doter1995
doter1995 是的,我已经做了一切!但它现在解决了!
接近 7 年之前 回复
dongmi1864
dongmi1864 你检查phpinfo()吗?
接近 7 年之前 回复
donglanzhan7151
donglanzhan7151 你在php.ini中修改后重新启动了web服务器吗?还请你分享db组件的主配置吗?
接近 7 年之前 回复
dsj60862
dsj60862 此外,我忘了分享我的配置。我正在使用:XAMPP控制面板v3.2.1,PHP5.4.19,Windows7,MSSQLServer2005
接近 7 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问