一、scws编译安装
wget http://www.ftphp.com/scws/down/scws-1.2.0.tar.bz2
二、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
/etc/init.d/php-fpm restart
测试mongo是否连通:
<?php
$m = new Mongo('mongodb://lxx:[email protected]: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