Table of Contents

Install PHP 7.3

$ sudo apt-get install php-7.3-common php7.3-fpm php-7.3-dev
$ sudo pecl install mongodb
$ sudo vi /etc/php/7.3/mods-available/mongodb.ini

After opening the new mongodb.ini with vi, add the following line and save he file:

extension=mongodb.so

Add symlinks to this newly created mongodb.ini file in the following folders:

cd /etc/php/7.3/cli/conf.d
sudo ln -s /etc/php/7.3/mods-available/mongodb.ini 20-mongodb.ini
cd /etc/php/7.3/fpm/conf.d
sudo ln -s /etc/php/7.3/mods-available/mongodb.ini 20-mongodb.ini

Stop and start the PHP-7.3 FPM Service to make these changes effective

sudo service php7.3-fpm stop
sudo service php7.3-fpm start