Skip to content

Composer can't find Mongo extension #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
exocuted opened this issue Mar 12, 2016 · 6 comments
Closed

Composer can't find Mongo extension #780

exocuted opened this issue Mar 12, 2016 · 6 comments

Comments

@exocuted
Copy link

Hi there,

I have trouble when getting this package to work. When executing composer require jenssegers/mongodb , I get the following error:

Using version ^3.0 for jenssegers/mongodb
./composer.json has been updated
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
    - jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
    - jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
    - mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
    - mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php.ini
    - /etc/php.d/20-bcmath.ini
    - /etc/php.d/20-bz2.ini
    - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-dom.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gd.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-intl.ini
    - /etc/php.d/20-mbstring.ini
    - /etc/php.d/20-mcrypt.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-posix.ini
    - /etc/php.d/20-shmop.ini
    - /etc/php.d/20-simplexml.ini
    - /etc/php.d/20-sockets.ini
    - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-sysvmsg.ini
    - /etc/php.d/20-sysvsem.ini
    - /etc/php.d/20-sysvshm.ini
    - /etc/php.d/20-tidy.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/20-xml.ini
    - /etc/php.d/20-xmlwriter.ini
    - /etc/php.d/20-xsl.ini
    - /etc/php.d/30-mysql.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
    - /etc/php.d/30-wddx.ini
    - /etc/php.d/30-xmlreader.ini
    - /etc/php.d/40-json.ini
    - /etc/php.d/40-zip.ini
    - /etc/php.d/50-mongo.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

I can't manage to troubleshoot this since both php -i | grep mongo and composer show --platform also seems to recognise the extension is active.

Has anyone experienced similar issues?

Thanks in advance.

BTW I'm using Fedora 23, PHP 5.6 and Apache 2.4.18

@jenssegers
Copy link
Contributor

You need the mongodb extension, not the mongo extension.

@exocuted
Copy link
Author

First of all, thanks for the help, much appreciated.

For anyone figuring out, I solved this by uninstalling the repo version of the PHP extension and then installing via PECL, just like this:

sudo pecl install mongo

Don't forget to add it to your php.ini file.

Thanks again for the help and have a good day!

@raselcse10
Copy link

raselcse10 commented May 26, 2016

sudo pecl install mongo already deprecated.
You can use sudo pecl install mongodb

@xindykatalina
Copy link

Hello,
sudo pecl install mongodb and install extension = mongodb.so extension and generates an error

/opt/lampp/bin/httpd: relocation error: /opt/lampp/lib/php/extensions/no-debug-non-zts-20121212/mongodb.so: symbol SSL_library_init, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference

I appreciate your help.

@vhoyer
Copy link

vhoyer commented Oct 30, 2016

I'm with the same problem @xindykatalina, did you managed to work this out?

@lanka-senanayaka
Copy link

lanka-senanayaka commented Jun 9, 2017

When installing mongo db using (I'm using nginx)
sudo pecl install mongodb
sometimes it gives phpize error so you need to run
apt-get install php7.0-dev (or php7.1-dev)
after that it will install mongodb successfully

don't forget to run
sudo service nginx restart

sudo /etc/init.d/php7.0-fpm restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants