Microsoft ODBC Driver 17 for SQL Server on MacOS MAMP Pro [duplicate] - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Friday, August 4, 2023

Microsoft ODBC Driver 17 for SQL Server on MacOS MAMP Pro [duplicate]

anyone please can help me? I'am new in developing php appliacations on mac (till now I developed on windows) and I need help with installing ODBC Driver 17 for SQL Server for MAMP Pro. I installed the driver according to the instructions on https://github.com/Braineee/microsoft-driver-on-mamp-for-mac/blob/master/README.md and the error is that the driver was not found.

Here are screenshot from phpinfo: phpinfo phpinfo

Extension in MAMP Pro are added: MAMP Pro

Files are copied into MAMP: MAMP Pro

PHP version: 8.1.13

How I'am connecting to MSSQL Server:

private const SQLdriver = 'ODBC Driver 17 for SQL Server';
private const SQLserver = '192.168.1.12';
private const SQLport = 1433;
private const SQLDBName = '?';
private const SQLusername = '?';
private const SQLpassword = '?';
private const SQLparameters = 'TDS_Version=8.0;ClientCharset=UTF-8;';
private const SQLDriverOptions = [PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL];

$dsn = 'DRIVER=' . self::SQLdriver . ';' . 'SERVER=' . self::SQLserver . ';' . (empty(self::SQLport) ? '' : 'PORT=' . self::SQLport . ';') . 'DATABASE=' . ($this->dbType === Marfos::DB_TYPE_MAIN ? self::SQLDBName : self::SQLDBNameTest) . ';' . self::SQLparameters;
$this->pdo = new PDO("odbc:" . $dsn . "", self::SQLusername, self::SQLpassword);
$this->pdo->setAttribute(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL);

The connection on windows WAMP server is good. On mac I tried everything, but the driver was not found.

Thank you very much for your answers.

I searched all webs and tried everyrthing to install the ODBC Driver a I expect help.



source https://stackoverflow.com/questions/76817548/microsoft-odbc-driver-17-for-sql-server-on-macos-mamp-pro

No comments:

Post a Comment