系统版本: centos6
php版本:php-5.5.14
[root@localhost ~]# cd php-5.5.14/ext/mssql
[root@localhost mssql]# /usr/local/php/bin/phpize
[root@localhost mssql]# ./configure --with-php-config=/usr/local/php/bin/php-config
报错:
configure: error: Cannot find FreeTDS in known installation directories
FreeTDS是一个程序库,可以实现在Linux系统下访问微软的SQL数据库!
下载TDS:
[root@localhost ~]# wget -c ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.95.89.tar.gz
[root@localhost freetds-0.95.89]# ./configure --prefix=/usr/local/freetds
[root@localhost freetds-0.95.89]# make &&make install
回到php扩展mssql目录:
[root@localhost mssql]# ./configure --with-php-config=/usr/local/php/bin/php-config --with-mssql=/usr/local/freetds/
[root@localhost mssql]# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
编辑php.ini载入模块
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/"
extension = "mssql.so"
重启服务。
通过phpinfo就可以看到mssql模块了。
专注于 服务器运维与web架构
E-mail:venus#rootop.org