🥐
Install the SQL Server Driver for PHP on M1 Macbook
Issue
sudo pecl install sqlsrv-5.10.1
and sudo pecl install pdo_sqlsrv-5.10.1
exit with an error saying 'sql.h' file not found
on M1 Mac.
Solution
brew install unixodbc
-
sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install sqlsrv
sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install pdo_sqlsrv
For more details, please refer to an installation guide by Microsoft.
Discussion