说明:
Linux服务器系统:CentOS 5.5
Web环境:LAMP或者LNMP
Windows服务器系统:Windows Server 2003
Windows服务器IP地址:192.168.21.134
数据库环境:SQL Server 2000数据库
数据库账号:sa
数据库密码:123456
实现目的:Linux服务器中的php程序能够连接到Windows服务器中的SQL Server 2000数据库
具体步骤:
一、在Linux服务器中安装freetds
1、安装编译工具及驱动程序
yum install make apr* autoconf automake gcc gcc-c++ wget
2、安装unixODBC驱动程序
yum -y install unixODBC unixODBC-devel
3、安装freetds
cd /usr/local/src
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz #下载
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、配置freetds
cp /usr/local/freetds/etc/freetds.conf /usr/local/freetds/etc/freetds.confbak #备份原有文件
vi /usr/local/freetds/etc/freetds.conf #在最后位置修改编辑以下内容
系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容版权所有,转载请注明出处及原文链