PHP extensions path in ubuntu

11,601

Solution 1

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

Solution 2

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

Share:
11,601
bitcodr
Author by

bitcodr

Adaptable professional with proven communication, problem-solving, and technical skills. Aiming to leverage my abilities to successfully fill the Software Engineer role at a company. Frequently praised as hard-working by my peers, I can be relied upon to help a company achieve its goals. I'm eager to learn and enjoy my work.

Updated on June 04, 2022

Comments

  • bitcodr
    bitcodr almost 2 years

    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?

  • bitcodr
    bitcodr about 8 years
    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
  • bitcodr
    bitcodr about 8 years
    i do not use lampp
  • Jeff Puckett
    Jeff Puckett about 8 years
    this worked for me, did you make sure to restart the web server? i.e. sudo service apache2 restart
  • Pooja Jhadhav
    Pooja Jhadhav over 6 years
    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