I forget which distro I was using but there's a separate "php.ini"
file for the CLI. I found out the hard way when I was testing Mongo
via PHP's CLI. I had the extension listed in /etc/php.ini (for web
use) but for the life of me couldn't figure out why PHP couldnt load
the Mongo class via CLI. Low and behold, php-cli.ini or something like
that didn't have the extension.
On Jan 6, 3:03 am, Sam Millman <
smill...@nhbs.co.uk> wrote:
> try these packages:
>
> php5-dev
> php-pear
>
> then do:
>
> pecl install mongo
>
> then add:
>
> extension=mongo.so
>
> to the end of your php.ini
>
> On 6 January 2011 02:31, Kristina Chodorow <
krist...@10gen.com> wrote:
>
>
>
>
>
>
>
>
>
> > That error means the extension isn't being loaded. Are you running
> > phpinfo() from the same PHP process that you're running that script? The
> > command line uses a different PHP than your application server (which is
> > where I'm guessing you're running phpinfo()). If you're running the script
> > from the command line, run php -i.
>
> > You can install the driver and database in any order and they should work.
>
> >>
mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google
groups.com>
> >> .
> >
mongodb-user...@googlegroups.com<mongodb-user%2Bunsubscribe@google
groups.com>
> > .