Install PHP mssql extension on linux (cpanel example)

Quags

Administrator
Staff member
This example is for PHP mssql functions on linux. You need to first have the php source then install freeTDS.

At this writing php 5.3.21 was in use, and the source in /home/cpeasyapache/src/php-5.3.21

Download freeTDS from http://www.freetds.org/, extract and make

Code:
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz
tar -zxvf freetds-stable.tgz
#changes based on version
cd freetds-0.91
./configure --prefix=/opt/freetds && make
#(become root  / sudo make install or make install if you are already root)
make install
Move into /home/cpeasyapache/src/php-5.3.21/ext/mssql
Code:
phpize
./configure --with-mssql=/opt/freetds
make
make install
Add extension=mssql.so to php.ini and restart apache
 
Top