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

让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
    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

    点赞 评论

相关推荐