Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
1  
It is a requirement by PECL to compile the driver, you just need the package, nothing else –  Sammaye Sep 10 '13 at 10:14
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.