安裝pdo dblib擴充套件連線SQLserver

2022-11-24 17:16:30 字數 838 閱讀 1038

1、先得安裝freetds

wget

tar zxvf freetds-1.1.5.tar.gz

./configure --prefix=/usr/local/freetds --with-tdsver=7.4 --enable-msdblib --enable-shared --enable-stati

make && make install

2、版本檢視

# /usr/local/freetds/bin/tsql -c

在這裡,我輸入這個報錯:/usr/local/freetds/bin/tsql: error while loading shared libraries: libiconv.so.2: cannot open shared object file: no such file or directory

解決辦法很簡單,建立libiconv.so.2的軟連線即可(本系統是64位版本)

# ln -s /usr/local/lib/libiconv.so.2 /usr/lib64/libiconv.so.2

再是輸入版本檢視命令

# /usr/local/freetds/bin/tsql -c

3、安裝php擴充套件pdo_dblib

# cd /root/php-5.4.39/ext/pdo_dblib/

# /usr/local/php/bin/phpize

# ./configure –with-php-config=/usr/local/php/bin/php-config –with-pdo-dblib=/usr/local/freetds

# make && make install