If you need to connect to an MS Sql Server remotely from your DirectAdmin server via php, you need to rebuild PHP with necessary components. Get the latest stable release of FreeTDS and install it.

cd /root
wget ftp://ftp.astron.com/pub/freetds/current/freetds-current.tgz
tar -xvzf freetds-current.tgz
cd freetds-dev.0.92.377
./configure --prefix=/usr/local/freetds
make install

Now we should tell Direct Admin’s custom build that we want the MS Sql libraries installed using freetds.Edit the file :/usr/local/directadmin/custombuild/configure/ap2/configure.php5 add

--with-mssql=/usr/local/freetds \

to anywhere in the file. If you’re adding it the to end of the file, don’t add the \ at the end, instead add to the end of the line “before” the last line. Now go to custombuild and build the new PHP.

cd /usr/local/directadmin/custombuild
./build clean
./build php d

Check if MS Sql is intalled.

php -m|grep mssql

About The Author