简体   繁体   中英

Connect to SQL Server Server with SSL from PHP

How do I connect to a SQL Server with SSL from PHP?

Edit I should be more elaborate on this. We have a php-mysql application. We need to save data on a SQL Server also. Initially we were using mssql_connect('server', 'db_user', 'db_pwd') to connect to the remote SQL server. but now we need to send it over 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.

What have you tried already ?

mssql_connect() should work out for you.

Since you provided no error I'm guessing: "Warning: mssql_connect(): Unable to connect to: OURSERVER.local in ...." ?

Have you set the mssql.secure_connection ini option to true?

mssql_connect can use secured connection if php is configured ...

go into the php.ini and verify the mssql.secure_connection parameter :

[MSSQL]
mssql.secure_connection = On

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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