XAMPP with SQL Server in Macbook M1 (Laravel Project)

  laravel, mamp, php, sql-server, xampp

I am having errors by implementing XAMPP with SQL Server on my Macbook Pro M1, I am using docker to install SQL Server and XAMPP to serve my Laravel Projects.

The problem is when I put extension=sqlsrv.soand extension=pdo_sqlsrv.so in php.inionce restart the Apache the error messages occur like below:

[15-Sep-2021 08:34:03 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlsrv.so' (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so, 9): Symbol not found: _SQLAllocHandle
  Referenced from: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so
  Expected in: flat namespace
 in /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so), /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/pdo_sqlsrv.so.so, 9): image not found)) in Unknown on line 0
 
 15-Sep-2021 08:34:03 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'sqlsrv.so' (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so, 9): Symbol not found: _SQLAllocHandle
  Referenced from: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20200930/sqlsrv.so
  Expected in: flat namespace

I have also tried to implementing MAMP PRO with SQL Server and surprisingly the error messages are the same as this. I start to thinking, maybe this happens because of M1 Chip, I don’t know.

Source: Laravel

Leave a Reply