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
 /home/machine/php-5.6.14/ext/mssql
 cp -avr /home/machine/php-5.6.14/ext/mssql /usr/share/php5
 cd /usr/share/php5/mssql
 phpize
 ./configure --with-mssql=/usr/local/freetds-xxxxx
 make
At this point, ./modules/mssql.so must have been created.


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


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


5. check conf file
 \usr\local\freetds-xxxxx\etc\freetds.conf
 # A typical Microsoft server
 [sqlserver]
 host = 192.168.125.14
 port = 1433
 tds version = 7.0



Saving the comment

Add comment

Required Please choose another name

biuquote
  • Comment
  • Preview
Loading

192.168.15.197