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:
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.
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 install
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.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.