Tuesday 15 February 2011

mongodb - MongoClient PHP install on localhost -


I am trying to install a Mongo client on my local machine. I use MAMP to run Apache / PHP server.

I have installed Mongo using sudo pecl install mongo and it is successfully installed (I got the error pecl / mongo already installed and the release version 1.6.5 is similar to ). I then edited the php.ini line in mmp to add extension = php_mongo.dll and also tried the extension = mongo.so . In all cases, I get an error:

Fatal error: the class was not found in 'MongoClient' ....

Anyone can access my phpinfo () file There is no reference to Mongo in it.

Is there anything else to make sure that it is installed correctly?

Did you mongod Damon?

  $ ps -ef | Grep Mongo Mongodb 1240 1 0 2014? 05:25:28 / usr / sbin / mongod --quiet -f /etc/mongodb.conf  

if there is no output:

  sudo / Etc / init.d / mongodb start  

Can you connect to the command line eg.

  $ mongo MongoDB shell version: 2.4.3 to connect: test & gt; Show DBS ... & gt;  

Whether mongo.so extension has been installed eg.

  $ php -i 2 & gt; / Dev / null | Egrep "^ extension_dir = & gt;" Extension_dir = & gt; / Usr / lib64 / php5 / extensions = & gt; / Usr / lib64 / php5 / extensions $ ls / usr / lib64 / php5 / extensions | Grep mongo mongo.so $  

Whether the extension is loaded eg.

  $ php -i 2 & gt; / Dev / null | Grep /php.ini loaded configuration file = & gt; /etc/php5/cli/php.ini $ grep extension /etc/php5/cli/php.ini  

No comments:

Post a Comment