Search code examples
phpsql-serverwampphp-extension

PHP SQL server extensions broken


I'm trying to get PHP talking to MS SQL server by following this guide, which is for SQL server 2005 (I'm using 2014 express but it was the most recent I could find).

I'm running 32bit Wamp and PHP 5.5.12. I have installed php_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll in the ext folder and have added the following lines to php.ini:

extension=php_sqlsrv_55_ts.dll
extension=php_pdo_sqlsrv_55_ts.dll

All seems to go smoothly but no SQLSRV information is listed under phpinfo() and on the php extensions tab for Wamp they are listed but with a red triangle containing an exclamation mark next to them.

Anyone know what I've missed?


Solution

  • If you just type php at the command line it waits for more input, it does not hang.

    If when you run php from the command line ( PHP CLI ) you see sqlsrv is supported but not when you run phpinfo through Apache, then you have edited the wrong php.ini file. There are normally 2, one to control PHP CLI and one to control PHP when being run under Apache.

    The php.ini that controls php under apache is normally in the \apache\bin folder. The exact path is of course dependant upon whether you use WAMPServer/XAMPP... or install everything yourself.