简体   繁体   English

使用在XP / IIS上运行的PHP连接到MS SQL Server 2008

[英]Connect to MS SQL Server 2008 with PHP running on XP / IIS

I'm trying to connect to MSSQL 2008 from a (LAN) XP machine running IIS 5.1 & PHP 5.3. 我正在尝试从运行IIS 5.1和PHP 5.3的(LAN)XP计算机连接到MSSQL 2008。

I tried following this answer https://stackoverflow.com/a/5432118 我尝试遵循此答案https://stackoverflow.com/a/5432118

Problems started when I had no snapshot.txt , however as I am running IIS and PHP as FastCGI extension I am fairly confident I need the non-threadsafe dll ? 当我没有snapshot.txt ,问题就开始了,但是当我以IIS和PHP作为FastCGI扩展名运行时,我很有信心我需要非线程安全的dll吗?

Anyway, I downloaded SQLSRV30.EXE and extracted php_sqlsrv_53_nts.dll to my ext dir and added the extension to my php.ini . 无论如何,我下载了SQLSRV30.EXE并将php_sqlsrv_53_nts.dll SQLSRV30.EXE压缩到我的ext目录中,并将扩展名添加到了php.ini I also confirmed the extension_dir was correct & installed Microsoft SQL Server 2008 R2 Native Client before restarting IIS. 我还确认extension_dir是正确的并在重新启动IIS之前安装了Microsoft SQL Server 2008 R2本机客户端。

Unfortunately phpinfo() does not list sqlsrv as a loaded extension and I am now totally lost so any help would be highly appreciated. 不幸的是phpinfo()并未将sqlsrv列为已加载的扩展名,我现在完全迷失了,因此对您的帮助将不胜感激。

Thanks 谢谢

Ok, so I eventually got the the bottom of it so I thought I'd report back and hopefully save some else a head ache.... 好的,所以我最终找到了答案的底部,所以我想我应该报告一下,希望可以省下一些头痛的事情。

In my php.ini I set display_startup_errors = On , restarted IIS and reloaded the page. 在我的php.ini ,将display_startup_errors = On设置display_startup_errors = On ,重新启动IIS并重新加载页面。 At this point I got the magic nugget of information that for some reason was not being added to the log Fatal error: Unable to load Library........error: Access is denied . 此时,我得到了一个神奇的信息块,由于某种原因未将其添加到日志中Fatal error: Unable to load Library........error: Access is denied

So I navigated to the ext dir and selected the extension 所以我导航到ext目录并选择了扩展名

Right Click > Properties > Security

And added permissions for Users & Power Users - restarted IIS and boom sqlsrv was loaded. 并为“ UsersPower Users ”添加了权限-重新启动IIS,并加载了繁荣sqlsrv。

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

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