microsoft / msphpsql

Microsoft Drivers for PHP for SQL Server
MIT License
1.8k stars 371 forks source link

driver not loading in Mamp pro and can run PHP 8.1.13 or PHP 8.2. #1441

Closed Ravenna closed 1 year ago

Ravenna commented 1 year ago

PHP version 8.1 or 8.2 PHP SQLSRV or PDO_SQLSRV version Not sure Microsoft ODBC Driver version 18 SQL Server version 17 Client operating system OSX Ventura 13.2

Table schema

Problem description
Running my mac m1 on the latest osx. I have Mamp pro and can run PHP 8.1.13 or PHP 8.2.

I followed this: https://learn.microsoft.com/en-us/answers/questions/705302/sql-server-on-mamp?orderby=oldest but replaced everything with my PHP version and odbc v18.

Everything appears to be installed but I have a few issues:

  1. Nothing is added to php.ini with the extension
  2. If I try sudo pecl install sqlsrv Password: MYPW PHP Warning: Module "sqlsrv" is already loaded in Unknown on line 0

Warning: Module "sqlsrv" is already loaded in Unknown on line 0 PHP Warning: Module "pdo_sqlsrv" is already loaded in Unknown on line 0

Warning: Module "pdo_sqlsrv" is already loaded in Unknown on line 0 PHP Warning: Module "pdo_sqlsrv" is already loaded in Unknown on line 0

Warning: Module "pdo_sqlsrv" is already loaded in Unknown on line 0 pecl/sqlsrv is already installed and is the same as the released version 5.10.1 install failed

--

Been looking through Google, Git, stack. Any ideas?

Expected behavior and actual behavior

Repro code or steps to reproduce

andremartinez commented 1 year ago

Some recent issues mentioned a problem with unixodbc (or so it seems)

The comment here (https://github.com/microsoft/msphpsql/issues/1436#issuecomment-1428031768) suggests installing the version 2.3.7 of unixodbc (and some other dependencies) is a workaround for the problem

See if that helps

Ravenna commented 1 year ago

Thanks @andremartinez. I am on OSX and can't seem it install unixodbc version 2.3.7. Gonna keep digging.