PHP Fatal error: Uncaught Error: Class ‘MongoClient’ not found in /var/www/html/mongo/mongo. “_id” : ObjectId(“5d5a969006e247a47fe2dc88”),īut while I am going to connect with PHP7.2 using below code:
└─25309 /usr/bin/mongod –unixSocketPrefix=/run/mongodb –config /etc/nfĪug 19 20:25:31 user systemd: Started An object/document-oriented database.Īfter that I have create DB and insert one record for test result are as below: Install MongoDB on AWS Ubuntu EC2 Instance Import the public key used by the package management system Add Sources Reload local package database. Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset: enabled)Īctive: active (running) since Mon 20:25:31 IST 59s ago First update the system software package cache to have the most latest version of the repository listings.
Run the command below to accomplish this: sudo apt update. Ubuntu’s official software package repositories comes with the latest version of MongoDB, and can be easily installed using the APT package manager. The first thing when installing MongoDB is to update your server package list to the latest version. rvice – An object/document-oriented database Step 1: Installing MongoDB on Ubuntu 18.04.To read that post, click on the link below:
We have written a great tutorial on how to install and configure MongoDB on Ubuntu Linux. Issue the following command to create a list file for MongoDB. After installing the MongoDB, start the MongoDB service and enable it to start at system reboot: systemctl start mongod. Next, install the MongoDB server package with the following command: apt install mongodb-org -y.
Import they key for the official MongoDB repository 2. Once the repository is added, update the repository with the following command: apt update -y. To test Apache2 setup, open your browser and browse to the server hostname or IP address and you should see Apache2 default test page as shown below. How To Install MongoDB On Ubuntu 16.04 1. sudo apt updateĪfter installing Apache2, the commands below can be used to stop, start and enable Apache2 service to always start up with the server boots. To install Apache2 HTTP server on Ubuntu, run the commands below.
When you’re ready to get MongoDB setup on Ubuntu with Apache2 and PHP support, continue with the steps below: How to install Apache on Ubuntu Linux Ubuntu is the modern, open source Linux operating system for desktop, servers and other devices. Also, for students and new users learning Linux, the easiest place to start learning is on Ubuntu Linux.