Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Cleon's avatar

Connecting to SQL Server from MacOS?

Hey all, I'm working on an application that connects against an existing SQL Server DB. I've got the connection working fine on my PC (from MAMP even) with the "sqlsvr" driver. However, since that's not available for Mac, I've compiled the mssql.so library and put it in the extensions directory. phpinfo() shows me that mssql is correctly installed, but when trying to run a basic query I get "Unsupported driver [mssql]." Any ideas?

0 likes
3 replies
d3xt3r's avatar

How does your database.php look like ? Have you tried using sqlsrv instead of mssql?

Cleon's avatar

AFAIK sqlsrv is Windows-only. Swapping it out just gives me a "Driver not found" error.

noeldiaz's avatar

@Cleon getting SQL Server to play nice from outside of windows is a pain. I know, I gave up and just moved the relevant php files to IIS on the SQL server. :) But your question got me wondering and I found this link with some more suggestions for under OSX [https://github.com/BellevueCollege/public-docs/blob/master/PHP/configure-mssql-pdodblib-mac.md].

Some things listed here I have not tried. Might give it a shot here soon. In case it helps. If I get to try it I'll report back.

Please or to participate in this conversation.