php追加编译scws、mysqli和mongo、pgsql扩展模块
2012-09-20 10:34
471 查看
一、scws编译安装
wget http://www.ftphp.com/scws/down/scws-1.2.0.tar.bz2 tar jxf scws-1.2.0.tar.bz2 cd scws-1.2.0./configure --prefix=/opt/scws make && make installcd phpext//opt/php-5.3.8/bin/phpize ./configure --with-scws=/opt/scws --with-php-config=/opt/php-5.3.8/bin/php-config make && make installvim /opt/php-5.3.8/etc/php.ini extension = "scws.so"/etc/init.d/php-fpm restart
二、mongo编译安装
下载http://webscripts.softpedia.com/scriptDownload/MongoDB-PHP-Driver-Download-70187.html
tar zxf mongo-php-driver-1.3.7.tar.gz
cd mongo-php-driver-1.3.7
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config
make && make install
vim /opt/php/etc/php.ini
extension = "mongo.so"/etc/init.d/php-fpm restart
测试mongo是否连通:
<?php
$m = new Mongo('mongodb://lxx:123@127.0.0.1:27017');
//mongodb://username:password@IP:port
$a = $m->connect();
if($a){
echo"success";
}
else{
echo"wrong";
}
?>
三、mysqli安装
进入php源码包php-5.3.8/ext/mysqli/
/opt/php/bin/phpize
./configure --prefix=/usr/local/mysqli --with-php-config=/opt/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
make && make install
在php.ini中添加extension = "mysqli.so",重启php-fpm
但报错:PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'mysqli.so' in Unknown on line 0
原来我服务器上的php是5.2.4版本,而我用高版本的5.3.4的php源码去追加编译,导致不兼容。重新下载5.2.4的php重复上面安装过程即可。
四、pgsql
1、进入php编译目录下的 ext/pgsql/ 下;
2、根据php安装位置 执行 /usr/local/php/bin/phpize;
3、./configure --with-php-config=/usr/local/php/bin/php-config
4、make && make install
5、将编译完的扩展添加到 php.ini 最后 重启php-fpm
wget http://www.ftphp.com/scws/down/scws-1.2.0.tar.bz2 tar jxf scws-1.2.0.tar.bz2 cd scws-1.2.0./configure --prefix=/opt/scws make && make installcd phpext//opt/php-5.3.8/bin/phpize ./configure --with-scws=/opt/scws --with-php-config=/opt/php-5.3.8/bin/php-config make && make installvim /opt/php-5.3.8/etc/php.ini extension = "scws.so"/etc/init.d/php-fpm restart
二、mongo编译安装
下载http://webscripts.softpedia.com/scriptDownload/MongoDB-PHP-Driver-Download-70187.html
tar zxf mongo-php-driver-1.3.7.tar.gz
cd mongo-php-driver-1.3.7
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config
make && make install
vim /opt/php/etc/php.ini
extension = "mongo.so"/etc/init.d/php-fpm restart
测试mongo是否连通:
<?php
$m = new Mongo('mongodb://lxx:123@127.0.0.1:27017');
//mongodb://username:password@IP:port
$a = $m->connect();
if($a){
echo"success";
}
else{
echo"wrong";
}
?>
三、mysqli安装
进入php源码包php-5.3.8/ext/mysqli/
/opt/php/bin/phpize
./configure --prefix=/usr/local/mysqli --with-php-config=/opt/php/bin/php-config --with-mysqli=/usr/bin/mysql_config
make && make install
在php.ini中添加extension = "mysqli.so",重启php-fpm
但报错:PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'mysqli.so' in Unknown on line 0
原来我服务器上的php是5.2.4版本,而我用高版本的5.3.4的php源码去追加编译,导致不兼容。重新下载5.2.4的php重复上面安装过程即可。
四、pgsql
1、进入php编译目录下的 ext/pgsql/ 下;
2、根据php安装位置 执行 /usr/local/php/bin/phpize;
yum install postgresql-devel
3、./configure --with-php-config=/usr/local/php/bin/php-config
4、make && make install
5、将编译完的扩展添加到 php.ini 最后 重启php-fpm
相关文章推荐
- 编译php追加postgresql的pgsql扩展模块
- 编译php增加postgresql的pgsql和pdo_pgsql扩展模块
- 不重新编译PHP,单独添加扩展模块的方法
- php官方docker追加扩展模块笔记
- 用phpize单独编译安装PHP扩展模块
- 在编译好的PHP环境中安装PHP扩展模块
- 编译PHP的SCWS中文分词扩展
- php动态编译mysqli扩展
- Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)
- 不重新编译php添加扩展模块
- php5.5以上版本编译扩展模块方法
- Centos 7(Linux)环境下安装PHP(编译添加)相应动态扩展模块so(以openssl.so为例)
- PHP扩展开发之动态加载so模块与静态重编译PHP(下)
- php5.3动态编译gd库 zlib扩展 mcrypt扩展 mysqli扩展
- c写php扩展之编译php源码,创建扩展模块,编写扩展demo
- php支持scws扩展模块
- PHP 扩展编译通用办法(以memcache ,mysqli扩展为例)
- LINUX下PHP编译添加相应的动态扩展模块so(不需要重新编译PHP,以openssl.so为例)
- c写php扩展之编译php源码,创建扩展模块,编写扩展demo
- linux 下php扩展模块的单独编译