You are not logged in.

#1 2015-03-19 17:56:48

alexandernst
Member
Registered: 2010-04-02
Posts: 61

[SOLVED] Installing Mongo extension for PHP

I'm experiencing a really weird problem with mongo's extension for PHP and composer.
I installed php-mongo and php-fpm (pacman -S php-mongo php-fpm). Without modifying anything in my php.ini, I restarted ph-fpm and then ran php -m.
The output says that mongo extension is loaded correctly.
Then I created a simple test.php with a phpinfo() and that one also says that mongo is loaded.

Anyways, when trying to install yii2-mongo with composer (which depends on ext-mongo), I get this fail:


Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for yiisoft/yii2-mongodb 2.0.3 -> satisfiable by yiisoft/yii2-mongodb[2.0.3].
    - yiisoft/yii2-mongodb 2.0.3 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.


Where is the problem? Why does composer thinks mongo-ext isn't loaded?

Last edited by alexandernst (2015-03-19 20:51:32)

Offline

#2 2015-03-19 18:37:59

alexandernst
Member
Registered: 2010-04-02
Posts: 61

Re: [SOLVED] Installing Mongo extension for PHP

Oh, fixed. Just for the record, in case anybody gets here, the command "composer" in Arch is actually a symlink to `/usr/bin/composer: a /usr/bin/php -nc/usr/share/php-composer/php.ini`.
That is correct, the command "composer" is using it's own php.ini file (bad idea perhaps?). Anyways, just add the mongo.so extension in that file and you'll be ok.

Offline

#3 2015-03-19 20:21:30

pdgessler
Member
From: Milwaukee, WI
Registered: 2011-04-06
Posts: 23

Re: [SOLVED] Installing Mongo extension for PHP

Glad you got it sorted. Please remember to mark your thread as solved by editing its title. Cheers!

Offline

Board footer

Powered by FluxBB