How to install mongodb extension for PHP on Plesk Server

Please login to your respective VPS server and be sure that you are having full root access to the file system. This can be  done either by directly login as root or using another switching tools like 'sudo' or 'su'. As for this tutorial, we are going to install mongodb extention to PHP 7.0. If you are about to us a different PHP version. Please change the number 7.0 to respective PHP version.

1. Before you start, please make sure that extention_dir has been defined inside your php.ini pointing to the correct path. as for example:

extension_dir = "/opt/plesk/php/7.0/lib64/php/modules/"


2. Now install the latest compiling application dependencies.

yum install gcc openssl-devel plesk-php70-devel


3. Force the php_suffix to the correct PHP version that you are about to use.

/opt/plesk/php/7.0/bin/pecl config-set php_prefix /opt/plesk/php/7.0/bin/


4. You will need to use PECL as a tool to installed this extention modules.

/opt/plesk/php/7.0/bin/pecl install mongodb


5. Once installation has been success. Please browse to /opt/plesk/php/7.0/lib64/php/modules/ and set the correct permission to mongodb.so. Normally we will use 755.

cd /opt/plesk/php/7.0/lib64/php/modules/
chmod 755 mongodb.so


6. Now you can enable mongodb extention. Please create or edit /opt/plesk/php/7.0/etc/php.d/mongodb.iniand add below into the file.

echo "extension=mongodb.so" > /opt/plesk/php/7.0/etc/php.d/mongodb.ini








Was this answer helpful?

Also Read

How to login to my Stack Server instance without using password on Windows 7/8/10?

1. Download puttygen HERE 2. Open PuTTy application and go to Category tree on your left hand...

How to access Stack Server instance?

Issue:You are able to see that your subscribe instance status shows running and by clicking on...

PHP Warning: PHP Startup: modulename: Unable to initialize module

You find a lot of errors inside your error_log for your httpd server which stating PHP Warning:...

What is the difference between Smart VPS Server and Stack Server?

This article were prepared to help customers to understand the diffrence between Smart VPS and...

How to convert SSH keys to .ppk?

Below are the steps that you should follow to convert the SSH public key to .ppk for later use...