2

I've been trying to connect to a SQL Server Express instance using php 7.1 from webtatic.

Here are things I have tried

$DBH = new PDO("dblib:host=10.10.0.81:1434;dbname=database_name", "username", "password")

$DBH = new PDO("dblib:host=10.10.0.81,1434;dbname=database_name", "username", "password")

$DBH = new PDO("dblib:host=10.10.0.81\SQLEXPRESS:1434;dbname=database_name", "username", "password")

$DBH = new PDO("dblib:host=10.10.0.81:1434\SQLEXPRESS;dbname=database_name", "username", "password")

$DBH = new PDO("dblib:host=10.10.0.81,1434;dbname=database_name", "username", "password")

And many others. The error I always get is "Unknown host machine name" I have tried connecting with the IP and with the hostname and neither work. I can ping the IP just fine and there isn't a firewall blocking the port.

It is using a SQL Server instance and we manually assigned the IP 1434. I was able to verify it is working with a 3rd party client.

Keith
  • 1,352
  • 3
  • 21
  • 48

0 Answers0