1. Download MongoDB
Address: MongoDB,
2. Decompression: TAR-ZXF linux-x86_64-2mongodb.6.6.tgz
After decompression there will be a bin folder, which has a variety of executable programs, wherein MONGO indicates that MONGODB provides a shell terminal is also a JS parser.
The Mongod is used to start the MongoDB server.
3. Install the MongoDB extension for PHP.
Update some of the dependency library files for Yum:
Yum-y Update
Install the required extensions
Yum-y Install gcc php-pear php-devel
Use PHP extension pecl to install Mongodo, of course, you can go to GitHub to download the source files to build their own installation. This step will see that the mongo.so file was generated.
PECL Install MONGO
Modify the php.ini configuration file to add support for MongoDB. Add the MONGO dynamic library below the extension section.
Extension=mongo.so
To restart the Apache server:
Service httpd Restart
To test whether the installation was successful:
php-m | Grep-i MONGO (will output MONGO)
If the output of MONGO indicates that the installation was successful.
end~
PHP Install MongoDB Extension