Compile mssql driver for php with freetds and latest php

php latest and freetds with php for driver mssql Compile

1. install freetds
 download latest and extract in /etc/php5/fpm/ext/mssql/freetds-xxxxx
 chmod +x ./configure
 ./configure --enable-msdblib --prefix=/usr/local/freetds-xxxxx
 make && make install
 touch /usr/local/freetds-xxxxx/include/tds.h
 touch /usr/local/freetds-xxxxx/lib/libtds.a

2. Download the PHP source extract to
 cp -avr /home/machine/php-5.6.14/ext/mssql /usr/share/php5
 cd /usr/share/php5/mssql
 ./configure --with-mssql=/usr/local/freetds-xxxxx
At this point, ./modules/ must have been created.

3. Install the mssql extension
 cp modules/ /etc/php5/fpm/ext/mssql/

4. restart web server
 /etc/init.d/php5-fpm restart

5. check conf file
 # A typical Microsoft server
 host =
 port = 1433
 tds version = 7.0

Saving the comment

Add comment

Required Please choose another name

  • Comment
  • Preview