Php – how to install an older version of a pecl package

mac-osxmongodbpearpeclPHP

I have this code

    $passengerId = new \MongoId(oPassenger->getId());

    return $this->createQueryBuilder('Device')
        ->update()
        ->multiple(true)
        ->field('activated')->set(false)
        ->field('passenger')->unsetField()->equals($passengerId)
        ->field('_id')->notEqual($deviceId)
        ->getQuery()
        ->execute();

which works just fine on my dev server but crashes on my local machine.

running pecl list on dev returns

APC     3.1.13  beta
amqp    1.2.0   stable
intl    3.0.0   stable
mongo   1.3.7   stable

and on local returns:

mongo   1.5.6   stable
xdebug  2.2.5   stable

the crash message on my machine is

"name":"MongoException","message":"Invalid object ID"},"code":500}

I'v tried downgrading my local version of mongo but i couldn't figure it out with pecl's poor documentation. for example i tried this:

sudo pecl upgrade -f -c channel://pecl.php.net/mongo-1.3.7

but i keep on getting channel does not exist for all my channel permutations.

also running mongod --version locally returns db version v2.6.0 and on dev returns db version v2.4.3

ideas?

Best Answer

To downgrade, you can try this:

pecl install mongo-1.3.7


Then pecl list will show you that it worked.