Wednesday, March 6, 2013

Installing doctrine ODM through composer

I tried to install doctrine/doctrine-mongo-odm-module through composer with ZF2, but I keep getting an error stating that PHP mango extension is missing from my computer.This is the require section of my composer.json file,
"require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.*",
        "doctrine/doctrine-mongo-odm-module": "dev-master"
    }
 Im getting this after I run  "php composer.phar install"


Correct version of MongoDB driver shows up in phpinfo() as well.


And THE PROBLEM is, Composer runs on PHP-CLI I do have two php.ini files.

/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

But I only updated MongoDB extension "extension=mongo.so" in /etc/php5/apache2/php.ini.Composer in the other hand is looking for mongo extension in the php.ini located in the /etc/php5/cli/php.ini directory. So by adding mongo extension in /etc/php5/cli/php.ini  file and apache restart solved my problem.


No comments:

Post a Comment