How to add mongodb extension to php

WBOY
Release: 2016-07-25 09:12:17
Original
1018 people have browsed it

本节内容: PHP MongoDB 扩展安装

安装mongodb扩展:

  1. [root@jbxue ~]# wget http://pecl.php.net/get/mongo-1.3.4.tgz

  2. [root@jbxue ~]# tar zxvf mongo-1.3.4.tgz
  3. [root@jbxue ~]# cd mongo-1.3.4
  4. [root@jbxue mongo-1.3.4]# /usr/local/php/bin/phpize
  5. Configuring for:
  6. PHP Api Version: 20041225
  7. Zend Module Api No: 20060613
  8. Zend Extension Api No: 220060519
  9. [root@jbxue mongo-1.3.4]# ./configure –with-php-config=/usr/local/php/bin/php-config
  10. [root@jbxue mongo-1.3.4]# make && make install
  11. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

  12. [root@jbxue mongo-1.3.4]# ls /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

  13. memcache.so mongo.so pdo_mysql.so
  14. [root@jbxue mongo-1.3.4]# vi /usr/local/php/etc/php.ini
  15. #加入
  16. extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/”
  17. #extension = “memcache.so”
  18. #extension = “pdo_mysql.so”
  19. extension = “mongo.so”

  20. [root@jbxue mongo-1.3.4]# /etc/init.d/php-fpm restart

  21. Shutting down php_fpm . done
  22. Starting php_fpm done
  23. #phpinfo探针查看已支持mongodb

复制代码

更多内容,请参考本站mongodb数据库栏目中的内容。



source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template