简体   繁体   English

通过PHP从SSL连接到SQL Server Server

[英]Connect to SQL Server Server with SSL from PHP

How do I connect to a SQL Server with SSL from PHP? 如何通过PHP从SSL连接到SQL Server?

Edit I should be more elaborate on this. 编辑我应该对此进行更详细的说明。 We have a php-mysql application. 我们有一个php-mysql应用程序。 We need to save data on a SQL Server also. 我们还需要将数据保存在SQL Server上。 Initially we were using mssql_connect('server', 'db_user', 'db_pwd') to connect to the remote SQL server. 最初,我们使用mssql_connect('server','db_user','db_pwd')连接到远程SQL Server。 but now we need to send it over ssl. 但现在我们需要通过ssl发送它。

We would like to use the existing ssl cert already on server (currently used by site on IIS as ssl cert) to make it so we can connect to SQL Server with secure connection. 我们想使用服务器上已经存在的现有ssl证书(当前由IIS上的站点用作ssl cert)来制作它,以便我们可以通过安全连接连接到SQL Server。

What have you tried already ? 您已经尝试了什么?

mssql_connect() should work out for you. mssql_connect()应该适合您。

Since you provided no error I'm guessing: "Warning: mssql_connect(): Unable to connect to: OURSERVER.local in ...." ? 由于您没有提供任何错误,所以我猜测: "Warning: mssql_connect(): Unable to connect to: OURSERVER.local in ...."

Have you set the mssql.secure_connection ini option to true? 您是否已将mssql.secure_connection ini选项设置为true?

mssql_connect can use secured connection if php is configured ... 如果配置了php,mssql_connect可以使用安全连接...

go into the php.ini and verify the mssql.secure_connection parameter : 进入php.ini并验证mssql.secure_connection参数:

[MSSQL]
mssql.secure_connection = On

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

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