Avatar of ITBenelux
ITBenelux
Flag for Belgium asked on

Trouble installing the PHP PDO driver for MSSQL on Windows and Xampp

Hello,

I'm having trouble connecting with MSSQL on Xampp/Windows
(dev local server connecting to a distant DB (MSSQL 2005)).

The following Connection string work fine :

'odbc:DRIVER={SQL Server}; SERVER=' . SQLSRV_IP . ',' . SQLSRV_PORT . ';DATABASE=' . SQLSRV_DBNAME

so I don't think it have anything to do with DB rights or firewall but

'mssql:host=' . SQLSRV_IP . ';dbname=' . SQLSRV_DBNAME, SQLSRV_USER, SQLSRV_PWD

give me the following error message : 'could not find driver'.

I've search the web and stumble upon the following link by MS (which I hope is the latest version)

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05

I've installed the 4 .dll in /php/ext/ and added the following line in PHP.ini
extension=php_pdo_sqlsrv_53_ts_vc6.dll
extension=php_sqlsrv_53_ts_vc6.dll
but it still don't work (loading any other .dll give me various errors on apache startup)

Could someone tell me what I'm doing wrong or give me step by step instruction ?
I'm fairly new working with anything else than MySQL or PostgreSQL.

Thank you and kind regards.

PHPApache Web ServerMicrosoft SQL Server

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ITBenelux

ASKER
Thank you.

The following CS do work now :

sqlsrv:Server=' . SQLSRV_IP . ';Database=' . SQLSRV_DBNAME
Dave Baldwin

Good, glad to help.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23