:

PHP7: 安装 pdo_dblib 扩展

发布于:2020-3-25 9:02 作者:song100e 浏览:84 分类:Linux

安装unixODBC

wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
tar -zxvf unixODBC-2.3.4.tar.gz
cd unixODBC-2.3.4
./configure
make && make install

安装freetds

wget http://mirrors.ibiblio.org/freetds/stable/freetds-stable.tgz
tar -zxvf freetds-stable.tgz
cd freetds-*
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib  
    --with-gnu-ld --with-unixodbc=/usr/local
make && make install

进入php安装包目录、编译安装

cd /usr/local/php/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

修改配置,重启

vim /usr/local/php/etc/php.ini
extension = pdo_dblib.so
service php-fpm restart


标签: pdo_dblib

0