I recently had the pleasure(!) of trying to get PHP on Debian working correctly with a Microsoft SQL server so that the data could be migrated from a Mssql instance into a Mysql one.
Previous to this attempt, the developers were using a Windows machine as a ‘broker’ between the two database. This setup was much too slow for importing and exporting large amounts of data, so we decided to cut out the middle man (the Windows machine) and do all the processing on a single server.
First I needed to install a few prerequisite packages:
Next we need to download and uncompress the FreeTDS source code:
Next we use configure and install FreeTDS with the following options:
Next we need to download and uncompress the PHP source code:
Next we use configure and install PHP with the following options:
Lastly we will need to create and install the mssql module for PHP:
Now you should be able to connect to any Microsoft SQL (and Mysql) server from PHP using the functions found here.


I am currently working as a Sr. Linux System Administrator for National Public Radio in Washington D.C.

