脚本宝典收集整理的这篇文章主要介绍了怎么增加php mssql扩展,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
增加php mssql扩展的方法:1、下载freetds及php源码包;2、安装freetds;3、解压php源码包,并进入msSQL扩展目录;4、生成configure;5、编辑php.ini文件,加入mssql扩展即可。
本文操作环境:linux5.9.8系统、php-5.2.17版、DELL G3电脑
怎么增加php mssql扩展?
php安装mssql扩展
在FreeTDS 1.1版本之后,可以设置为auto,版本之前需要手动指定。
以前写过mssql模块安装,这次只是补充编译freetds时指定with-tdsver参数
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视频教程》
以上就是怎么增加php mssql扩展的详细内容,更多请关注脚本宝典其它相关文章!
以上是脚本宝典为你收集整理的怎么增加php mssql扩展全部内容,希望文章能够帮你解决怎么增加php mssql扩展所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。