First, install FreeTDS 1, install the compiler tools and drivers
Yum install make apr* autoconf automake gcc gcc-c++ wget
2. Install UNIXODBC Driver
Yum-y Install UnixODBC Unixodbc-devel
3, installation FreeTDS
Cd/usr/local/src
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz #下载, sometimes can not download with wget command
Gunzip freetds-stable.tgz #解压
TAR-XVF Freetds-stable.tar
CD freetds-0.91
./configure--prefix=/usr/local/freetds--with-tdsver=8.0--with-unixodbc=/usr--enable-msdblib #配置
Make #编译
Make install #安装
4, Configuration FreeTDS
Cp/usr/local/freetds/etc/freetds.conf/usr/local/freetds/etc/freetds.confbak #备份原有文件
Vi/usr/local/freetds/etc/freetds.conf #在最后位置修改编辑以下内容
TDS Version = 8.0 #8.0 for the database version of SQL Server, Here I change to 11.0 there is a problem, all do not change, using the default, I use 7.0 no problem
Second, test FreeTDS
/usr/local/freetds/bin/tsql-s 192.168.0.242-u hft_test #测试, Prompt for database password
Install the MSSQL extension into the installation package of MSSQL---phpize----/configure--with-php-config=/usr/local/php5/bin/php-config--WITH-MSS Ql=/usr/local/freetds
Iv. Laravel Framework requires installation of pdo_dblib.so
Go to Dblib--phpize in the installation package--/configure--with-php-config=/usr/local/php-5.4.12/bin/php-config-- With-pdo-dblib=/usr/local/freetds Five, Leravel frame configuration
Linux connects to the SQL Server database and configures Laravel to connect