Php MongoDB ConnectivityPhp provides mongodb driver to connect with mongoDB database. After installing it, we can perform database operations by using the php. Here, we are using Ubuntu 16.04 to create an example. This example includes the following steps. 1) Installing Driver2) Edit php.ini FileIt is store in the apache server directory /etc/php/7.0/apache2/php.ini 3) Install mongo-php libraryFollowing is the preferred way of installing this library with Composer. 4) Create Php Script// connect.php 5) Execute Php ScriptExecute this script on the localhost server. It will create database and store data into the mongodb. 6) Enter into Mongo ShellAfter executing php script, we can see the created database in mongodb. 6.1. Show Database The following command is used to show databases. 6.2. Show Collection The following command is used to show collections. 6.3. Access Records Well all set, this is working fine. We can also perform other database operations as well. Next TopicPython MongoDB |