Last Updated on August 22, 2022 by Vikash Ekka
How To Install Linux, Apache, MySQL, PHP (LAMP) on Ubuntu 20.04 LTS
What is PHP MongoDB driver ?
MongoDB driver is a PHP extension that manages the connection to the MongoDB server and enables you to perform all kinds of operations on a NoSQL database through PHP.
Same steps will also work on Ubuntu 20.04, 18.04 and CentOS 7, 8.
How to install mongodb extension for PHP on Ubuntu 22.04 LTS.
NOTE:- In my system I have installed php7.4 version
Step1. Update the apt repository
sudo apt update
sudo pecl install mongodb
sudo echo "extension=mongodb.so" >> /etc/php/7.4/cli/php.ini sudo echo "extension=mongodb.so" >> /etc/php/7.4/fpm/php.ini
sudo service nginx restart
Verify MongoDB Extension on Ubuntu 22.04
sudo echo "<?php phpinfo( ); ?>" >> /var/www/html/phpinfo.php
Enter the server IP address or domain name along /phpinfo.php in the browser URL address to execute php via web interface.
php -i | grep mongo
php -m
[…] How to install mongodb extension for PHP […]
[…] How to install mongodb extension for PHP – vetechno […]
[…] How to install mongodb extension for PHP […]