How install PHP's MongoDB driver — "pecl install mongo" fails

15,969

I don't know how locked into the pecl method you are, but I recently compiled the driver. This was on an ubuntu server. It installs the .so and all you have to do is just add "extension=mongo.so" to the php.ini files.

Share:
15,969
KajMagnus
Author by

KajMagnus

I develop https://www.talkyard.io — it's like open source StackOverflow, but with open-ended discussons, chat, and embedded comments. Unless otherwise mentioned: All original source snippets that I post on StackOverflow and StackExchange sites are licensed under Creative Common's CC0 (in addition to the license prescribed by StackOverflow.) Contact: kajmagnus3 at gmail ...

Updated on July 26, 2022

Comments

  • KajMagnus
    KajMagnus almost 2 years

    How do I install PHP's MongoDB client driver?

    I've done this already:

      $ sudo aptitude install php5-dev php5-cli php-pear make
    

    But the next step fails:

      $ sudo pecl install mongo
      No releases available for package "pecl.php.net/mongo"
      install failed
    

    When I have a look at http://pecl.php.net/mongo, I find listed many versions of the Mongo driver. Am I supposed to include a version number or something? However all installation instructions I've found simply state that one use sudo pecl install mongo and nothing else. — How do I install the Mongo driver?

    Some details:

    1. OS: Linux Mint 16, which is based on Ubuntu.

    2. pecl list-channels says:

       Registered Channels:
       Channel      Alias   Summary
       doc.php.net  phpdocs PHP Documentation Team
       pear.php.net pear    PHP Extension and Application
                            Repository
       pecl.php.net pecl    PHP Extension Community Library
       __uri        __uri   Pseudo-channel for static packages
      
  • KajMagnus
    KajMagnus about 10 years
    Thanks, this seems to have worked. I installed this exact version: github.com/mongodb/mongo-php-driver/tree/1.4.5
  • Daniel W.
    Daniel W. about 9 years
    PECL does nothing else than download, configure and compile the source, well. This is not an answer to the question, why PECL download fails.