Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

janisozolins's avatar

Installing missing PHP extension does not work

I am trying to import my existing Laravel project using Laravel Forge, however, when using my code from GitHub I get the following error:

Cloning into 'patientsapp.tk'...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for mongodb/mongodb 1.1.2 -> satisfiable by mongodb/mongodb[1.1.2].
    - mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
  Problem 2
    - mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your system.
    - jenssegers/mongodb v3.2.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.1.2].
    - Installation request for jenssegers/mongodb v3.2.2 -> satisfiable by jenssegers/mongodb[v3.2.2].

  To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.1/cli/php.ini
    - /etc/php/7.1/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.1/cli/conf.d/10-opcache.ini
    - /etc/php/7.1/cli/conf.d/10-pdo.ini
    - /etc/php/7.1/cli/conf.d/15-xml.ini
    - /etc/php/7.1/cli/conf.d/20-bcmath.ini
    - /etc/php/7.1/cli/conf.d/20-calendar.ini
    - /etc/php/7.1/cli/conf.d/20-ctype.ini
    - /etc/php/7.1/cli/conf.d/20-curl.ini
    - /etc/php/7.1/cli/conf.d/20-dom.ini
    - /etc/php/7.1/cli/conf.d/20-exif.ini
    - /etc/php/7.1/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.1/cli/conf.d/20-ftp.ini
    - /etc/php/7.1/cli/conf.d/20-gd.ini
    - /etc/php/7.1/cli/conf.d/20-gettext.ini
    - /etc/php/7.1/cli/conf.d/20-iconv.ini
    - /etc/php/7.1/cli/conf.d/20-igbinary.ini
    - /etc/php/7.1/cli/conf.d/20-imap.ini
    - /etc/php/7.1/cli/conf.d/20-intl.ini
    - /etc/php/7.1/cli/conf.d/20-json.ini
    - /etc/php/7.1/cli/conf.d/20-mbstring.ini
    - /etc/php/7.1/cli/conf.d/20-mcrypt.ini
    - /etc/php/7.1/cli/conf.d/20-msgpack.ini
    - /etc/php/7.1/cli/conf.d/20-mysqli.ini
    - /etc/php/7.1/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.1/cli/conf.d/20-pdo_pgsql.ini
    - /etc/php/7.1/cli/conf.d/20-pdo_sqlite.ini
    - /etc/php/7.1/cli/conf.d/20-pgsql.ini
    - /etc/php/7.1/cli/conf.d/20-phar.ini
    - /etc/php/7.1/cli/conf.d/20-posix.ini
    - /etc/php/7.1/cli/conf.d/20-readline.ini
    - /etc/php/7.1/cli/conf.d/20-shmop.ini
    - /etc/php/7.1/cli/conf.d/20-simplexml.ini
    - /etc/php/7.1/cli/conf.d/20-soap.ini
    - /etc/php/7.1/cli/conf.d/20-sockets.ini
    - /etc/php/7.1/cli/conf.d/20-sqlite3.ini
    - /etc/php/7.1/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.1/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.1/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.1/cli/conf.d/20-tokenizer.ini
    - /etc/php/7.1/cli/conf.d/20-wddx.ini
    - /etc/php/7.1/cli/conf.d/20-xmlreader.ini
    - /etc/php/7.1/cli/conf.d/20-xmlwriter.ini
    - /etc/php/7.1/cli/conf.d/20-xsl.ini
    - /etc/php/7.1/cli/conf.d/20-zip.ini
    - /etc/php/7.1/cli/conf.d/25-memcached.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

After that I tried to install this extension via the command line:

sudo apt-get install mongodb

However, when I run the same GitHub import procedure I get the same error as if I have never installed the mongodb extension.

What can be the problem here?

0 likes
2 replies
goatshark's avatar

@JANISOZOLINS Perhaps try installing the php-mongodb package.

sudo apt-get install php-mongodb

Also, php -i | grep mongo might/should yield results if the modules are loading correctly.

3 likes
Cronix's avatar

also be sure to restart the php7.x-fpm service after

Please or to participate in this conversation.