php添加mongodb扩展的方法
本文导语: 本节内容: PHP MongoDB 扩展安装 安装mongodb扩展: 代码示例: [root@xxx ~]# wget http://pecl.php.net/get/mongo-1.3.4.tgz [root@xxx ~]# tar zxvf mongo-1.3.4.tgz [root@xxx ~]# cd mongo-1.3.4 [root@xxx mongo-1.3.4]# /usr/local/php/bin/phpize Configuring for: PHP Api Ve...
本节内容:
PHP MongoDB 扩展安装
安装mongodb扩展:
[root@xxx ~]# wget http://pecl.php.net/get/mongo-1.3.4.tgz
[root@xxx ~]# tar zxvf mongo-1.3.4.tgz
[root@xxx ~]# cd mongo-1.3.4
[root@xxx mongo-1.3.4]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
[root@xxx mongo-1.3.4]# ./configure –with-php-config=/usr/local/php/bin/php-config
[root@xxx mongo-1.3.4]# make && make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
[root@xxx mongo-1.3.4]# ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
memcache.so mongo.so pdo_mysql.so
[root@xxx mongo-1.3.4]# vi /usr/local/php/etc/php.ini
#加入
extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/”
#extension = “memcache.so”
#extension = “pdo_mysql.so”
extension = “mongo.so”
[root@xxx mongo-1.3.4]# /etc/init.d/php-fpm restart
Shutting down php_fpm . done
Starting php_fpm done
#phpinfo探针查看已支持mongodb
更多内容,请参考本站mongodb数据库栏目中的内容。