doufu6423 2015-01-30 22:08
浏览 65
已采纳

让PHP Sql Server驱动程序在PHP 5.5中运行

I am trying to get PHP with the SQL Server driver working under IIS. I had a similar situation 18 months ago with lesser versions of the php and the driver and Apache, and that code worked fine working on Windows Server 2003.

I am trying to set it up on my Windows 7 (Home Premium) Virtual Machine to work out how to do it, before attempting to get the same done on a Windows Server 2011.

Now I am coming to try the same code again and reset up my development environment. This time I am using PHP 5.5 and have installed the threadsafe version version of the driver php_pdo_sqlsrv_55_ts.dll obtained from the downloadable SQLSERVER31.exe file.

Doing all of this in 32 bit mode

As soon as I try and construct a new PDO I get the following error message

SQLSTATE[IMSSP]: This extension requires the ODBC Driver 11 for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712

So although that link isn't directly to the driver, I eventually find my way there and download it, only for it to fail to install. However, I think that might be because I already have the ODBC Driver 11 for SQL Server installed.

So according to my Data Sources (ODBC) application in the Administrative Tools Section there are two SQL Server ODBC drivers

  • SQL Server, verion 6.01.7602.17514 SQLSRV32.DLL Dated 21/11/2010
  • SQL Server Native Client 11, version 2011.110.5058.00 SQLNCLI11.DLL Dated 15/05/2014

So I really don't know how to go from here.

Can I remove a driver and re-install it. If so how? Any other suggestions as to how to get this to work.

  • 写回答

1条回答 默认 最新

  • douzhuiqiu4923 2015-02-02 23:41
    关注

    I discovered the answer to my problem. I hadn't installed the odbc driver - the drivers listed above are not the correct ones.

    The reason the ODBC driver I downloaded failed to install wasn't because the driver was already installed - it was because I had downloaded the 32 bit version, and it HAS to be the 64 bit version.

    As soon as I installed the 64 bit version, another entry appeared in the Data Sources Driver list, and my test program started to work

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败