• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Install Extension MONGODB for PHP in DEBIAN 10

Pinuccio

New Pleskian
Hello,
I have problems installing the mongodb extension for php on Debian 10 and PLESK.

I tried to install the extension using PECL.

sudo /opt/plesk/php/7.4/bin/pecl install mongodb



RESULT:

Libraries have been installed in:
/tmp/pear-build-root3CAfNf/mongodb-1.10.0/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear-build-root3CAfNf/install-mongodb-1.10.0" install
Installing shared extensions: /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr/lib/php/20180731/
running: find "/tmp/pear-build-root3CAfNf/install-mongodb-1.10.0" | xargs ls -dils
926160 4 drwxr-xr-x 3 root root 4096 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0
926722 4 drwxr-xr-x 3 root root 4096 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr
926723 4 drwxr-xr-x 3 root root 4096 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr/lib
926724 4 drwxr-xr-x 3 root root 4096 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr/lib/php
926725 4 drwxr-xr-x 2 root root 4096 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr/lib/php/20180731
926721 8012 -rwxr-xr-x 1 root root 8200832 Aug 30 14:35 /tmp/pear-build-root3CAfNf/install-mongodb-1.10.0/usr/lib/php/20180731/mongodb.so

Build process completed successfully
Installing '/usr/lib/php/20180731/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.10.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini


The library was installed in the wrong directory.
Anyone know how I can fix it?
 
Installed without any problems with:

# apt install plesk-php74-dev make gcc
# /opt/plesk/php/7.4/bin/pecl install mongodb
......
Build process completed successfully
Installing '/opt/plesk/php/7.4/lib/php/modules/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.10.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
......

# echo "extension=mongodb.so" > /opt/plesk/php/7.4/etc/php.d/mongo.ini
# plesk bin php_handler --reread
# /opt/plesk/php/7.4/bin/php -m | grep mongo
mongodb
 
Back
Top