Here are the steps for me to walk a novice PHP for the first time to install the MONGO module:
1. First select the appropriate version of the MongoDB expansion pack download from the Internet;
2. Unzip the expansion pack and enter the unzip directory;
TAR-ZXF mongo-1.4.1.tgz
CD mongo-1.4.1
3. Execute phpize in the mongo-1.3.2 directory with the following command: (Note: This tool is a tool for adding extensions to PHP, my phpize location is/www/php/bin/phpize)
/usr/local/php/bin/phpize
Note: Ken can make the following error:
Configuring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
Cannot find autoconf. Please check your autoconf installation and the
$PHP _autoconf environment variable. Then, the rerun this script
The problem is that M4 and autoconf are not installed
Continue execution: Yum-y Install M4 autoconf generates configure file
4. Execute the following command:
./configure--with-php-config=/usr/local/php/bin/php-config
Note: The –with-php-config parameter needs to specify the location of the Php-config file, not the location of the php.ini file
Creating Libtool
Appending configuration Tag "CXX" to Libtool
Configure:creating./config.status
Config.status:creating config.h
5. Review the configuration information if it is correct, compile and install:
Make&&make Install
The correct compilation execution results are as follows:
Build complete.
Don ' t forget to run ' make test '.
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20130712/
6. After compiling the installation, add a sentence in php.ini:
Extension=mongo.so
7. Restart PHP-FPM or Web service, view phpinfo, if there is MongoDB, congratulations, the installation was successful. (Source: Programmer)
PHP Novice installs MONGO for the first time