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

jdc1898's avatar
Level 21

Laravel Herd w/MS SQL

I am using Laravel Herd on a M1 MAC running Ventura OS and am running into an issue connoting to a MS SQL Server. I have installed the PHP extensions and loaded them using the following guides below. However, after restarting, I am no able to connect to the MS SQL DB. Anyone have any ideas on how I can resolve this?

Error:

  SQLSTATE[IMSSP]: This extension requires the Microsoft ODBC Driver for SQL Server to communicate with SQL Server. Access the following URL to download the ODBC Driver for SQL Server for arm64: https://go.microsoft.com/fwlink/?LinkId=163712 (Connection: sql01, SQL: select * from [network_addresses])

Installing SQLSRV & PDO_SQL https://gist.github.com/bubba-h57/7b01ef8882ca04b6b9dd552aa15aad8c

Installing Extensions on Herd: https://herd.laravel.com/docs/1/advanced-usage/additional-extensions

I have PHP versions installed: 8.0 8.1 8.2 8.3

PHP 8.2.11 (cli) (built: Sep 29 2023 00:10:16) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies

PHP Extensions

php -m | grep sql   
mysqli
mysqlnd
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
pgsql
sqlite3
sqlsrv
0 likes
9 replies
jdc1898's avatar
Level 21

I also verified via phpinfo() that the modules are loaded.

pdo_sqlsrv 5.11.1

PDO mysql, pgsql, sqlite, sqlsrv

jdc1898's avatar
jdc1898
OP
Best Answer
Level 21

Well, I removed everything and re-installed and it's working now... Here is what I did for anyone who finds this thread.

HOMEBREW_ACCEPT_EULA=Y brew reinstall msodbcsql18 mssql-tools18

4 likes
dadsteph's avatar

Hi

I got this message trying to connect to the DB:

[0] => 08001 [SQLSTATE] => 08001 [1] => -1 [code] => -1 [2] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate] [message] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]

I'm stuck trying to solve it..... Please help.

jhavens's avatar

@dadsteph You can also fix this by going to your config/database.php file; scroll to the sql server connection settings you're using, then update:

// config/database.php
return [

    // ...

    'connections' => [
          // ...

          'sqlsrv' => [ // <- or, whatever your SQL Server connection is called
              'driver' => env('DB_DRIVER', 'sqlsrv'),
          
              // ... 
          
              // 1. uncomment this line
              // 2. make sure it resolves to 'true'
              'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'true'),
          ],   
    ],
]
nspaul's avatar

@jdc1898 Are you using SQL Authentication to connect, or a Windows domain account? I've been fighting with these drivers for over a day now and it's looking more and more like Windows domain accounts just aren't going to work. On Linux, I'm able to use the Freetds package and it works great, but not on Mac.

jdc1898's avatar
Level 21

@nspaul In my case I was using SQL auth. The version of MS SQL was 2016 so it had an outdated version of SSL resulting in a TLS issue. I fought with it too long trying to get me MAC to use an older version of TLS that it wasn't worth the effort. We moved the server to a newer version of SQL that supported TLS 1.3 and my issues were resolved.

nspaul's avatar

@jdc1898 Glad to hear y'all found a way through! I'm thinking more and more that I'll need to do something similar find a way to "side-step" my Mac->MSSQL situation.

Please or to participate in this conversation.