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 Normally we will use 755.

cd /opt/plesk/php/7.0/lib64/php/modules/
chmod 755

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 "" > /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 check which application is consuming process

if you found out the server is higly loaded and not able to access throug cpanel but still able...

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 access Stack Server Ubuntu/Debian instance using SSH/Putty?

Issue:You are able to see that your subscribe Ubuntu/Debian instance status shows running and you...