• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Driver mongodb in plesk php7.4

arekumaro

New Pleskian
Hi :)

I have a server with Plesk and Centos 7.
I configured a domain to PHP version 7.4 and wanted to add the mongodb extension to it.
Well I ended up installing the mongodb extension to the server by executing: php -r "phpinfo();" mongo appears on the server
MongoDB support => enabled
MongoDB extension version => 1.12.0
MongoDB extension stability => stable
But not when I run phpinfo on a domain php file or /opt/plesk/php/7.4/bin/php -r "phpinfo();".
I have performed the following actions and they have not worked:
1st
yum install plesk-php74-dev make gcc
apt-get install plesk-php71-dev build-essential
2nd
/opt/plesk/php/7.4/bin/pecl install mongodb
3rd
echo "extension=mongodb.so" > /opt/plesk/php/7.4/etc/php.d/mongo.ini
I also tried:
echo "extension=mongodb.so" > /opt/plesk/php/7.4/etc/php.d/mongodb.ini
echo "extension=mongo.so" > /opt/plesk/php/7.4/etc/php.d/mongo.ini
4th
plesk bin php_handler --reread
5th
/opt/plesk/php/7.4/bin/php -m | grep mongo
answer: mongodb
6th
plesk bin php_settings -u
7th
Whenever I finish some test I execute:
/etc/init.d/nginx restart
service httpd restart
I've even tried going to PHP from Plesk and putting the extension in the .ini, it didn't work either.
When executing my php file it tells me:
Fatal error: Uncaught Error: Class 'MongoDB\Driver\Manager' not found
But it's because I can't add the extension.
Please I need your help, thank you.
 

Attachments

  • Captura de pantalla 2022-01-21 a las 9.47.37.png
    Captura de pantalla 2022-01-21 a las 9.47.37.png
    290.2 KB · Views: 4
Try:
Bash:
/opt/plesk/php/7.4/bin/pecl config-set php_prefix /opt/plesk/php/7.4/bin/
/opt/plesk/php/7.4/bin/pecl install mongodb

And add extension=mongodb.so to /opt/plesk/php/7.4/etc/php.ini

Don't forget to run service plesk-php74-fpm restart to restart PHP if you run fpm.
 
Last edited:
Hi Rasp.
[root@ss2 ~]# cd /
[root@ss2 /]# cd /opt/plesk/php/7.0/etc/
-bash: cd: /opt/plesk/php/7.0/etc/: No existe el fichero o el directorio
[root@ss2 /]# service php7.4-fpm restart
Redirecting to /bin/systemctl restart php7.4-fpm.service
Failed to restart php7.4-fpm.service: Unit not found.
[root@ss2 /]#
[root@ss2 /]# cd /opt/plesk/php/
[root@ss2 php]# ls
7.3 7.4

:( :(
 
@arekumaro, sorry I mixed up the version numbers in m'n previous post. I've edited my previous post with the right commands. Try again if you like.
 
Hi Rasp.
I did the steps you told me and it doesn't work.
 

Attachments

  • Captura de pantalla 2022-01-21 a las 12.07.29.png
    Captura de pantalla 2022-01-21 a las 12.07.29.png
    63.3 KB · Views: 9
Did you run ?
Bash:
/opt/plesk/php/7.4/bin/pecl config-set php_prefix /opt/plesk/php/7.4/bin/
/opt/plesk/php/7.4/bin/pecl install mongodb
 
[root@ss2 php.d]# /opt/plesk/php/7.4/bin/pecl config-set php_prefix /opt/plesk/php/7.4/bin/
PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /opt/plesk/php/7.4/lib64/php/modules/mongodb.so (/opt/plesk/php/7.4/lib64/php/modules/mongodb.so: cannot open shared object file: No such file or directory), /opt/plesk/php/7.4/lib64/php/modules/mongodb.so.so (/opt/plesk/php/7.4/lib64/php/modules/mongodb.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

:( :( It gives me an error if I run the first.
 
Remove extension=mongodb.so (or comment out) from /opt/plesk/php/7.4/etc/php.ini, restart PHP, and try to run the other commands again.
 
[root@ss2 php.d]# /opt/plesk/php/7.4/bin/pecl config-set php_prefix /opt/plesk/php/7.4/bin/
config-set succeeded
[root@ss2 php.d]# /opt/plesk/php/7.4/bin/pecl install mongodb
pecl/mongodb is already installed and is the same as the released version 1.12.0
install failed

And add extension=mongodb.so to /opt/plesk/php/7.4/etc/php.ini
Run service plesk-php74-fpm restart to restart PHP if you run fpm.

Nothing at all. :( :(
 
Try uninstalling your current installation of mongodb. Afterwards try again with the commands from my previous post.
Try:
Bash:
/opt/plesk/php/7.4/bin/pecl config-set php_prefix /opt/plesk/php/7.4/bin/
/opt/plesk/php/7.4/bin/pecl install mongodb

And add extension=mongodb.so to /opt/plesk/php/7.4/etc/php.ini

Don't forget to run service plesk-php74-fpm restart to restart PHP if you run fpm.
 
Back
Top