无法安装PHP的mssql扩展

We're using a MSSQL db at work and I want to be able to write PHP scripts that fetches data directly from the db to my local MAMP environment. I've tried installing pdo_sqlsrv and sqlsrv using Homebrew and I've tried compiling the extensions on my own using PECL commands, but in both cases it has ended unsuccessfully with the error message:

fatal error: 'sql.h' file not found

I've been googling this problem all day and can't seem to find a solution that I can get to work/understand. I'd be grateful for any help or hints.

Computer: Macbook Pro 2018 (macOS 10.13.6)

Local environment: MAMP PRO 4.5 (PHP version: 7.2.1)

I found the solution here: https://github.com/Microsoft/msphpsql/issues/198

I was missing tools provided by unixodbc, so:

brew install unixodbc

...provided the .h file(s) I was missing. The PECL installer was then able to locate the required libraries. In case it wouldn't have worked, I would have tried:

sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install pdo_sqlsrv
sudo CXXFLAGS="-I/usr/local/opt/unixodbc/include" LDFLAGS="-L/usr/local/lib" pecl install sqlsrv

...as suggested in the link.