如何在MAC中为Laravel安装mssql驱动程序(sqlsrv)?

Im trying to connect to mssql server from My Mac OS. My application development OS is MAC.

I try to download the driver here[1], but it is not for MAC.

Can anyone shed some light on how to install the mssql driver for php/laravel in MAC?

[1]https://docs.microsoft.com/en-us/sql/connect/php/download-microsoft-php-driver-for-sql-server

Change the default driver from mysql to

 'default' => 'sqlsrv',

In sqlsrv array provide the correct details to you sql IP

  'sqlsrv' => array(
   'driver' => 'sqlsrv',
   'host' => ' ip adress', 
   'database' => 'database',
   'username' => 'root',
   'password' => '',
   'prefix' => '',
  ),

You can also addition key values to array if you like.

Found on. Do you need help with this set up?

Follow this guide MS have put together to install the necessary dependencies to create PHP apps with SQL Server: https://www.microsoft.com/en-us/sql-server/developer-get-started/php/mac/

If you have PEAR installed you can run the below command"

sudo pecl install sqlsrv pdo_sqlsrv
sudo echo "extension= pdo_sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
sudo echo "extension= sqlsrv.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`