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. Before we proceed please read the disclaimer below.

DISCLAIMER: I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).

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.

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-stable

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 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:

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

Labels: , , , , ,


At October 8, 2007 at 5:48:00 PM PDT , Anonymous Anonymous said...

I encountered an error: C compiler cannot create executables...

what should i do?


Post a Comment

Subscribe to Post Comments [Atom]

<< Home