msphpsql icon indicating copy to clipboard operation
msphpsql copied to clipboard

SQL Server 2008; PHP version 8.2.8

Open keithyeohh opened this issue 2 years ago • 1 comments

PHP version
8.2.8

PHP SQLSRV or PDO_SQLSRV version
5.11.0

Microsoft ODBC Driver version
ODBC Driver 13 for SQL Server

SQL Server version
2008

Problem description
Attempted to connect to the SQL server from my Laravel php application. I am getting the following error.

SQLSTATE[01000]: [unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.13.dylib' : file not found

When I following the trail to locate the file, it somewhat exists in the directory. Screenshot 2023-07-11 at 4 34 46 PM

Screenshot 2023-07-11 at 4 35 47 PM

Tried to symlink it, but no luck still

sudo ln -s /opt/homebrew/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /opt/homebrew/etc/odbc.ini /etc/odbc.ini

keithyeohh avatar Jul 11 '23 08:07 keithyeohh

It sounds like the ODBC driver might be missing a dependency. However ODBC driver 13 is quite old, I would recommend trying a newer one, such as 18 or 17 (18 has some security features on by default), in particular because the newer drivers have a reduced number of dependencies.

v-makouz avatar Jul 12 '23 16:07 v-makouz

Closed due to inactivity

v-makouz avatar Aug 15 '24 21:08 v-makouz