3

I want to install a php package in ubuntu. that package need to php mongo extension and i installed and i put in /etc/php5/cli/php.ini :

extension=mongo.so

But i got an error to install that package :

the requested PHP extension mongodb is missing from your system.

So when I want to know where is the mongo extension i typing php -i | grep extension_dir shows :

extension_dir => /usr/lib/php5/20131226 => /usr/lib/php5/20131226

And when typing php-config --extension-dir shows :

/usr/lib/php5/20121212

I think extensions path is wrong but i dont know, how can i fix that?

0

3 Answers 3

2

use sudo apt-get install php5-mongo you will have it working. hope it helps :)

Sign up to request clarification or add additional context in comments.

1 Comment

this worked for me, did you make sure to restart the web server? i.e. sudo service apache2 restart
1

Install your mongo.so in your lampp

/opt/lampp/lib/php/extensions/

Keep this path in your

/opt/lampp/lib/php/php.ini file

extension=mongo.so

1 Comment

i do not use lampp
0

try this

sudo apt-get install php5-mongo

if that doesnt work try these sudo apt-get install php5-dev make php-pear sudo pecl install mongo sudo echo "extension=mongo.so" | sudo tee /etc/php5/mods-available/mongo.ini

2 Comments

i got error to install php5-dev : The following packages have unmet dependencies: php5-dev : Depends: libpcre3-dev but it is not going to be installed Recommends: pkg-php-tools but it is not going to be installed E: Unable to correct problems, you have held broken packages
Alright try this... ** $ sudo apt-get -f install ** $ sudo apt-get install php and hit TAB key on your keyboard a few times, which should give you something like this Display all 492 possibilities? (y or n) Then go ahead and hit 'y' you would see all the possible values

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.