MSSQL SUPPORT FOR PHP VIA EASYAPACHE

yum install  unixODBC unixODBC-devel

wget http://mirrors.ibiblio.org/freetds/stable/freetds-stable.tgz
tar -zxvf freetds-stable.tgz
cd freetds-*

./configure
make -jx      (x=current cpu+1  if you have dual core use 3  for quad core use 5 etc..)
make install

Add the following line in the file /etc/ld.so.conf :
include /usr/local/freetds/lib

5. Run the following command
ldconfig -v

6. Add mssql to compile options of EasyApache
nano /var/cpanel/easy/apache/rawopts/all_php5
and add:
--with-mssql=/usr/local/freetds

. Run /scripts/easyapache or build it from WHM. You don’t need to select any additional options here. Just build it. Once the build completes, you should now be able to use PHP’s MSSQL connector functions.

Note
If you are running a 64bit OS and get an error about configure: error:
Could not find /usr/local/freetds/lib64/libsybdb.a|so
then you need to do the following:


ln -s /usr/local/freetds/lib/libsybdb.so.5 /usr/lib64/libsybdb.so.5
ln -s /usr/local/freetds/lib/libsybdb.so.5 /usr/local/freetds/lib64/libsybdb.so
ldconfig -v

Thats it.

you can test your php via this command;

php -i | grep mssql

 

Leave a Reply

Your email address will not be published.