Reference URL Https://docs.moodle.org/29/en/Installing_MSSQL_for_PHP#Using_FreeTDS_on_Debian_Lenny
The first step is to download the appropriate DLL
PHP version |
Thread Safe |
FreeTDS version |
Download URL |
PHP 5.2.x (VC6) |
Yes |
0.82 + 20090302 Patches |
download! |
No |
0.82 + 20090302 Patches |
download! |
PHP 5.3.x (VC6) |
Yes |
0.82 + 20090904 Patches (unconfirmed) |
download! |
No |
0.82 + 20090904 Patches (unconfirmed) |
download! |
PHP 5.3.x (VC9) |
Yes |
0.82 + 20090904 Patches |
download! |
No |
0.82 + 20090904 Patches |
download! |
Step two, add Extension=php_dblib.dll to the php.ini.
Step three, restart IIS
Sample code to test if the connection is OK
<? PHP $link = mssql_connect (' localhost ', ' db_user ', ' Db_password '); if (! $link { echo' Could not connect '; die (' Could not connect: '. mssql_error ()); } Echo' successful connection '; Mssql_close ($link);? >
PHP 5.3 Configuration MSSQL Notes