I'm trying to install mongodb in a PHP environment. MongoDB itself is installed fine, I've run pecl install mongo
, and added extension=mongo.so
to php.ini; but my Laravel application complains that it can't find the class MongoClient. Checking phpinfo() reveals no mention of Mongo, suggesting that it isn't aware of the driver.
I noticed that all the instructions for installing mongo on Ubuntu mention apt-get install php5-dev
. Is that a requirement for the mongodb php driver? At the moment the server is built with Chef and installs php with apache2::mod_php5
. If php5-dev
is required, can it be installed as an apache module?
Yeah you should as stated by docs here http://docs.mongodb.org/ecosystem/drivers/php/ Also if its unable to find mongo drivers ,Try debugging , check logs if it says something like mongo.so file is missing.
Don't forget to restart php and apache after saving php.ini