0

I am getting the following error when trying to connect to a SQL Server via PHP: database connect error:SQLSTATE[01000]: [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1' : file not found

I have verified the file really does exist via

ls -l /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1

which yields

-rwxr-xr-x 1 root root 17306000 Jul  3 06:34 /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1

My connection code is:

$dns="sqlsrv:Server=192.168.X.X;Database=999";

try
{
    $mspdo = new PDO($dns, "user", "password");
}
catch(PDOException $pe)
{
     die("database connect error:". $pe->getMessage());
}

I'm at a loss.

Floyd Resler
  • 1,786
  • 3
  • 22
  • 41
  • Maybe helpful: https://stackoverflow.com/a/24388244/1301076 – rjdown Oct 30 '18 at 21:14
  • That did resolve the missing file error. However, it is now telling me that Microsoft requires libssl 1.0.0. I am running 1.1.0. Is there any way around that or some other way I can connect to a SQL Server in PHP 7? – Floyd Resler Oct 31 '18 at 10:56

0 Answers0