PHP PDO connect to MS SQLServer Express using SSL

2020-04-06 01:54发布

问题:

I have a remote MS-SQL Express 2012 server that is set up for use with SSL. I have all the certs I need. But how can I create a PDO connection to this server using SSL? I have found plenty of articles for PDO with MySQL using SSL, but none for MS-SQL using PDO and SSL.

回答1:

(Microsoft OS Only) In order to connect securely, append 'encrypt=true' to the connection string. A valuable blog on the topic.

Also Of Note:

Make sure you are using:

  • Microsoft Drivers

Make sure you aren't using:

  • Outdated
  • Wrong Driver

The drivers are located here: Microsoft provided drivers.