WAMP 服务器上 PHP 5.6 的 Sqlsrv [英] Sqlsrv for PHP 5.6 on WAMP server

查看:35
本文介绍了WAMP 服务器上 PHP 5.6 的 Sqlsrv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看了这么多关于这个问题的帖子,我不明白为什么它不起作用,因为它应该起作用.我将发布我目前掌握的所有信息:

  • Windows 10 64 位

  • WampServer 3 64 位(

    对我做错了什么或为什么它没有出现在 phpinfo() 中的任何想法?

    解决方案

    我找到了问题所在.

    似乎我使用的是 microsoft 32 位 sqlsrv 驱动程序,它不适用于 wampserver 3 64 位.

    用于 PHP 的官方 Microsoft SQL Server 驱动程序:此处 32 位 - 如果您有 32 位 wampserver,请使用它.

    用于 PHP 的非官方 Microsoft SQL Server 驱动程序:此处 64 位 - 如果您有 64 位服务器,请使用此选项.

    使用非官方版本后,出现在phpinfo()上!

    无论如何,我希望这个答案对那些花了几个小时四处寻找答案的人有用......或者其他什么,我希望它有用.

    After looking so many posts about this problem, I don't understand why it don't work because it should be working. I will post all the information I have so far:

    I downloaded SQLSRV32.exe from microsoft. I extracted the dll files to C:\wamp\bin\php\php5.6.16\ext.

    In my php.ini given by wampserver:

    • extension_dir = "c:/wamp/bin/php/php5.6.16/ext/"

    • extension=php_sqlsrv_56_ts.dll

    • extension=php_pdo_sqlsrv_56_ts.dll

    I have php5ts.dll in my php5.6.16 folder, so I think I have thread safe which is why I am using ts.dll ones.

    If I'm in phpinfo() I should see a 'sqlsrv' section in there, but I don't see one, so I guess I did something wrong here somewhere?

    I even did restart on wampserver many times and run as an administrator. It still don't show up on phpinfo()... But I can see this in php extension at the Wampserver:

    Any ideas to what I did wrong or why it don't show up in phpinfo()?

    解决方案

    I have found what was the problem.

    It seems that I was using microsoft 32-bit sqlsrv driver, which don't work with wampserver 3 64-bit.

    Official Microsoft SQL Server Driver for PHP: Here 32 bit - use this if you have a 32bit wampserver.

    Unofficial Microsoft SQL Server Driver for PHP: Here 64 bit - use this if you have a 64bit server.

    After using the unofficial version, it showed up on phpinfo()!

    Anyway, I hope this answer is useful to people who have spend looking around for an answer in hours... or whatever, I hope it was useful.

    这篇关于WAMP 服务器上 PHP 5.6 的 Sqlsrv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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