Php install mongo extension phpmongo extension installation: The server environment CentOS5.664-bit, php version 5.2.17 compilation and installation, installation path/usr/local/php first download the latest phpmongodb extension source code, the source code can be in http: // install the mongo extension in pe php
Php mongo extension installation:
64-bit Cent OS 5.6 server environment, php 5.2.17 compiling and installation, installation path/usr/local/php
First download the latest php mongodb extension source code. the source code can be downloaded at http://pecl.php.net/package/#to
Wget http://pecl.php.net/get/mongo-1.2.2.tgz
Tar zxf mongo-1.2.2.tgz
Cd mongo-1.2.2
After entering the folder, first run phpize to prepare the compiling extension environment. here is the introduction of phpize.
/Usr/local/php/bin/phpize
----------------------------------------------
The following solutions are available for installation exceptions:
Based on the lamp environment installed in yum in this blog, phpize is located at/usr/bin, php-config is located at/usr/bin, and php. ini is located at/etc/
1. first, download the corresponding mongodbextended package from http://pecl.php.net/package.
2. decompress the extension package and enter the decompressed directory.
Tar-zxf mongo-1.4.1.tgz
Cd mongo-1.4.1
3. execute phpize in the mongo-1.3.2 directory, the command is as follows :( Note: This tool is php add extension tool, my phpize location is/www/php/bin/phpize)
/Usr/local/php/bin/phpize
Note: Sometimes there is a bleeding error:
Processing ING:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and
$ PHP_AUTOCONF environment variable. Then, rerun this script
The problem is that m4 and autoconf are not installed.
You can download the http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz installation package installation
After editing, add a line to your php. ini file.
Extension = mongo. so
The default php INI file is
/Usr/local/php/etc/php. ini
Restart your web server or php-fpm and print phpinfo. if you see the mongo entry table, the mongodb extension is successfully installed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.