新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
怎么增加phpmssql擴展
本文操作環(huán)境:linux5.9.8系統(tǒng)、php-5.2.17版、DELL G3電腦

怎么增加php mssql擴展?
php安裝mssql擴展
關于freetds編譯時with-tdsver參數(shù)
在FreeTDS 1.1版本之后,可以設置為auto,版本之前需要手動指定。
以前寫過mssql模塊安裝,這次只是補充編譯freetds時指定with-tdsver參數(shù)
1、下載freetds及php源碼包
[root@VM_0_11_centos ~]# wget -c ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.1.21.tar.gz [root@VM_0_11_centos ~]# wget -c http://museum.php.net/php5/php-5.2.17.tar.gz
2、安裝freetds
# 解壓freetds源碼包
[root@VM_0_11_centos ~]# tar zxvf freetds-1.1.21.tar.gz [root@VM_0_11_centos ~]# cd freetds-1.1.21/
# 開始編譯安裝
[root@VM_0_11_centos ~]# ./configure --prefix=/usr/local/freetds --with-tdsver=7.3 --enable-msdblib [root@VM_0_11_centos ~]# make && make install
3、編譯mssql模塊
# 解壓php源碼包
[root@VM_0_11_centos ~]# tar zxvf php-5.2.17.tar.gz
# 進入mssql擴展目錄
[root@VM_0_11_centos ~]# cd php-5.2.17/ext/mssql/
# 生成configure
[root@VM_0_11_centos mssql]# /www/server/php/52/bin/phpize
# 開始編譯
[root@VM_0_11_centos php-5.2.17]# ./configure --with-php-config=/www/server/php/52/bin/php-config --with-mssql=/usr/local/freetds [root@VM_0_11_centos php-5.2.17]# make && make install
4、編輯php.ini文件,加入mssql擴展,在 491 行下面添加(如果不會用vi編輯器,可直接將文件下載改完再傳上去)
[root@VM_0_11_centos ~]# vi /www/server/php/52/etc/php.ini extension_dir = "/www/server/php/52/lib/php/extensions/no-debug-non-zts-20060613/" extension = mssql.so # 新增行
保存退出,重啟php或者重啟服務器。
當前題目:怎么增加phpmssql擴展
本文路徑:http://www.5511xx.com/article/cosscpc.html


咨詢
建站咨詢
