简体   繁体   English

IIS 7 / PHP 5.4中的SQLSRV覆盖网站输出

[英]SQLSRV Overriding Website Output in IIS 7/PHP 5.4

I have a simple setup of IIS 7 with PHP 5.4 . 我有一个使用PHP 5.4IIS 7的简单设置。 Everything has been working fine until I needed to add MS SQL Server support. 在我需要添加MS SQL Server支持之前,一切工作正常。 I downloaded the SQLSRV package provided through this link , extracted the appropriate DLLs to my PHP ext directory and added the extension entry/configuration in php.ini like so: 我下载了通过此链接提供的SQLSRV软件包,将相应的DLL解压缩到我的PHP ext目录中,并在php.ini添加了扩展项/配置,如下所示:

; MS SQL Server

extension=php_sqlsrv.dll
;extension=php_pdo_sqlsrv.dll

[sqlsrv]
sqlsrv.LogSubsystems=-1
sqlsrv.LogSeverity=-1
sqlsrv.WarningsReturnAsErrors=0

... with an additional change to the extension_dir setting: ...对extension_dir设置进行了其他更改:

extension_dir = "ext"

..., and restarted my server. ...,然后重新启动我的服务器。 Now, when I run any request, I get: 现在,当我运行任何请求时,我得到:

PHP_RINIT for php_sqlsrv: entering
sqlsrv.WarningsReturnAsErrors = Off
sqlsrv.LogSeverity = -1
sqlsrv.LogSubsystems = -1
sqlsrv.ClientBufferMaxKBSize = 10240
PHP_RSHUTDOWN for php_sqlsrv: entering

Sometimes, the first line is missing, but it's generally the same problem. 有时,第一行会丢失,但这通常是相同的问题。 No page is generating proper text/HTML anymore! 没有页面可以再生成正确的文本/ HTML! What has happened? 发生了什么事? Thanks. 谢谢。

On the balance of probability, I imagine you're using the wrong sqlsrv dll. 从概率的角度来看,我想您使用的是错误的sqlsrv dll。 First things first: did you download SQLSRV from here ? 首先,您是从这里下载SQLSRV吗?

I'll assume you want the PDO version (I use it; it works very well!). 我假设您想要PDO版本(我使用它;它工作得很好!)。 From the file name, I can't tell what you have, but for your circumstances you should should be using php_pdo_sqlsrv_54_nts.dll . 从文件名,我不知道您拥有什么,但是对于您的情况,您应该使用php_pdo_sqlsrv_54_nts.dll As you're using IIS, you'll have an NTS version of PHP, which should be used with non thread safe extensions. 使用IIS时,将具有PHP的NTS版本,该版本应与非线程安全扩展一起使用。

Try replacing the dll you're using with that one, and reload the application pool in IIS. 尝试用该dll替换您正在使用的dll,然后在IIS中重新加载应用程序池。 phpinfo() should show sqlsrv as an available PDO driver. phpinfo()应该将sqlsrv显示为可用的PDO驱动程序。 Let me know how you get on... :) 让我知道你是怎么办的... :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM