Installing MongoDB
Now the latest version is 3.4
1:
sudo apt-key adv--keyserver HKP://keyserver.ubuntu.com:80--recv 0c49f3730359a14518585931bc711f9ba15703c6
2:
Echo " Deb [arch=amd64,arm64] Http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Multiverse " sudo Tee /etc/apt/sources.list.d/mongodb-org-3.4. List
3: Update apt
sudo apt-get update
4: Installation
sudo Install -y mongodb-org
MongoDB Open and close
sudo Service Mongod Start sudo service mongod stop
Installing the MongoDB PHP extension
Installing extensions using PECL
sudo Install Php-pear
If it is PHP7, install Php7.0-dev, otherwise install Php5-dev
sudo Install PHP7. 0 Pkg-config sudo Install MongoDB
Add extension=mongodb.so to PHP.ini
If the FPM is installed, the path is/etc/php/7.0/fpm/php.ini
Restart PHP7.0-FPM, refresh phpinfo () to see the expansion of MongoDB
Installing MongoDB on Ubuntu16.04