Installing MS SQL Server Client Library on Linux/Unix

 

Problem: Installing SQL Server client library on Debian/Ubuntu Linux.

If you want to install PHP on a Linux machine and want to use Sql Server as your database then you have to install FreeTDS library on your server machine so that you could make your PHP/Apache server machine talk to your SQL Server 2000 Database. Let's go through the installation steps.

I have used the instructions on Debian/Ubuntu server machines. Make sure you have GNU compilation tools and libraries.

In Debian/Ubuntu, try the following:

gcc -v
make -v

If you see the version numbers of the above two software that means gcc and make are installed on your computer. If you dont have these software installed then you have to first install them.

In Ubuntu, do the following

sudo apt-get install build-essential

This will install the necessary software on your computer. I'd recommend using wget FTP client to download the software on Linux/Unix machines.

wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz

The above command will download the software. Now, unzip and untar the downloaded gzipped tar file by executing the command below.

tar –xvzf freetds-stable.tgz

Enter the folder where you untarred the downloaded file.

cd freetds-0.64

Replace 0.64 with your version number. Configure and compile the software as follows (make sure you execute 'make install' command below as root):

./configure --prefix=/usr/local/freetds --enable-msdblib
make
# make install
cd ..

FreeTDS has been installed in the folder /usr/local/freetds. Now, if you want to install PHP then you have to configure PHP (while installing) using the switch as follows:

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

I hope this will be a greate help for you. Please let me know if you want me to write on something else.

Please feel free to use the comments form below if you have any questions or need more explanation on anything.

Tags

linux,

Popular Searches

linux, php, mysql, ubuntu, mysql mysql, tools, install mysql, gearman, source code, java

more>>

Comments (write a comment):

0 comments so far. Be the first one to leave a comment on this article.

 

Comment