How to install Mongo extensions on Linux systems

  
                

Many Linux users like to use the mongodb database, a handy database. However, some users want to install the mongodb extension, but do not know how to install it. Therefore, Xiaobian now teaches you how to install the mongodb extension. Users who need it can take a look.

installation steps:

environment

nginx /1.4.4

PHP 5.4.22

MongoDB 2.4.10

1. Download the extension installation package

wget http://pecl.php.net/get/mongo-1.4.5.tgz

2. Compile and install
>

tar xvf mongo-1.4.5.tgz -C /usr/src

cd /usr/src/mongo-1.4.5/

phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

3. Configure php.ini, add The following two lines

[mongo]

extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/mongo.so

4. Reload php-fpm, nginx

pkill php-fpm

/usr/local/php/sbin/php-fpm

/usr/local/Nginx/sbin/nginx -s reload

5. Verify that the installation is successful

php -m

Copyright © Windows knowledge All Rights Reserved