linux mssql sqlserver php freetds

linux mssql sqlserver php freetds

freetds
=================
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.9.tar.gz
./configure --prefix=/usr/local/freetds --enable-msdblib --enable-dbmfix
make && make install

=================
vim /usr/local/freetds/etc/freetds.conf

增加:
[global]
client charset = utf8

测试是否可用
TDSVER=7.0 /usr/local/freetds/bin/tsql -H 192.168.1.100 -p 1433 -U sa -P ***********
=================

cd /data/src/software/php-5.6.8/ext/mssql
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-mssql=/usr/local/freetds/
make
make install

pdo mssql
=================
/data/src/software/php-5.6.8/ext/pdo_dblib
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config  --with-pdo-dblib=/usr/local/freetds

发表评论

电子邮件地址不会被公开。 必填项已用*标注