Charles Charles - 1 year ago 97
PHP Question

Call to undefined function sqlsrv_connect() with WAMP

I know that this question has already been asked several times on this website but I'm seriously starting to wonder wheter I'm crazy or not.

My configuration : WampServer 2.5 64bits (PHP 5.5.12, Apache 2.4.9)

My steps:

  1. Download Microsoft Driver SQLSRV32.exe from

  2. Extract the files from the .exe downloaded on my desktop

  3. Copy php_sqlsrv_55_ts.dll and php_pdo_sqlsrv_55_ts.dll into C:\wamp\bin\php\php5.5.12\ext

  4. Edit C:\wamp\bin\php\php5.5.12\php.ini adding "extension=php_pdo_sqlsrv_55_ts.dll" and "extension=php_sqlsrv_55_ts.dll"

  5. Edit C:\wamp\bin\apache\apache2.4.9\bin\php.ini adding "extension=php_pdo_sqlsrv_55_ts.dll" and "extension=php_sqlsrv_55_ts.dll"

  6. Restart all services (I even tried to restart my computer, but nothing works)

I still get the error... So what am I missing to make this work ?

Answer Source

I finally found what was causing the problem. My Wamp was in 64 bits but the sqlsrv driver only works with 32 bits version. Now it works perfectly.