简体   繁体   English

Windows 2012R2连接到远程SQL2012 Server问题PHP Apache

[英]Windows 2012R2 connecting to remote SQL2012 Server issue PHP Apache

I have created a local project that connects to a SQL2012 database. 我创建了一个本地项目,该项目连接到SQL2012数据库。 On my local machine I have Windows 7 64Bit enterprise, with MS SQL drivers with no problem at all. 在我的本地计算机上,我有Windows 7 64位企业版,带有MS SQL驱动程序,完全没有问题。 I moved the project over to a Windows Server 2012R2 production machine. 我将项目移到Windows Server 2012R2生产计算机上。 I got the web server up and PHP working fine. 我启动了Web服务器,PHP运行正常。

I checked the phpinfo() file and sql drivers are enabled and sqlsrv is a 'registered stream' 我检查了phpinfo()文件并启用了SQL驱动程序,并且sqlsrv是“已注册的流”

I have try & catch blocks for all my connections to the database. 我对数据库的所有连接都有try&catch块。 No errors 没有错误

I have checked the Apache error logs and there is no indication of a problem connecting to the DB. 我已经检查了Apache错误日志,没有迹象表明连接到数据库有问题。

My project uses SQL authentication, using a Username and Password - not built in Windows Authentication. 我的项目使用SQL身份验证,并使用用户名和密码-Windows身份验证未内置。 I tried to change the password to a incorrect one ---> still no error?!! 我试图将密码更改为错误的密码--->仍然没有错误?!

I even tried to disable Domain, Public, and Private Window Firewalls. 我什至尝试禁用域,公共和专用窗口防火墙。 Still nothing. 依然没有。

I'm totally stumped, perhaps someone here may have some ideas. 我完全迷住了,也许有人在这里有一些想法。

Does anyone know if the SQLSRV30 pack is compatible with Windows 2012R2? 有人知道SQLSRV30包是否与Windows 2012R2兼容吗?

OK I have figured out what the problem was, I needed to install Microsoft® SQL Server® 2012 Native Client located at: http://www.microsoft.com/en-us/download/confirmation.aspx?id=29065# 确定,我已经知道问题出在哪里,我需要安装Microsoft®SQLServer®2012 Native Client,位于: http : //www.microsoft.com/zh-cn/download/confirmation.aspx?id=29065#

After that installed everything is working fine. 安装完后,一切正常。

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

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