Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:53:33+00:00 2026-06-07T09:53:33+00:00

I need the MongoDB PHP driver on my CentOS 5.4 machine. My PHP version

  • 0

I need the MongoDB PHP driver on my CentOS 5.4 machine. My PHP version is 5.1.6. I downloaded the RPM and installed it. That created several files in /usr/bin directory. I copied

/usr/bin/mongo

to

/usr/lib/php/modules

which was what extension_dir showed on doing phpinfo();.

I also added

extension=mongo.so

in /etc/php.ini.
However on executing my PHP script, i still get

Mongo class not found.

What’s going wrong here ?

Also, my phpinfo() shows PHP version 5.1.6 whereas running PHP from command line shows 5.3.3. Could anything be wrong with that ?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:53:35+00:00Added an answer on June 7, 2026 at 9:53 am

    You’re saying your webserver and command line PHP report different versions. These are going to be installed in different locations, and their extensions are API incompatible with each other.

    When you installed the php_mongo extension, it may have used the command line php to determine the directory to install the extension to.

    Make sure you have the correct php_mongo for the php version of your webserver, and it is in the correct extensions directory. (get the directory from the php.ini returned by phpinfo())

    I hope you realise PHP 5.1 is also many years out of date. Unless you have a specific reason to use a version that old, you should also look at upgrading to a more recent version.

    Edit:

    Just read your comment “I must also mention that /usr/bin/mongo is a binary executable file but its not having a .so extension. Im copying it as is to /usr/lib/php/modules”

    No no no! 🙂

    This is the mongo command line client. This is not the PHP extension!

    You can run a find /* -name "mongo.so" to see where the installer put the file, this will probably also give you an indication of which version of PHP it was installed for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the MongoDB driver for PHP and I need to find some
I need to delete a bunch of files, stored in Mongo's GridFS that are
I need to create a server-side app that saving information to a mongoDB ,
Working with Nodejs and MongoDB through Node MongoDB native driver. Need to retrieve some
I have a Tab Separated Value file that I need to import in mongodb
I have a system that stores data into a MongoDB database. Now I need
I'm using MongoDB with PHP's own driver and I have saved multiple arrays under
I'm new in mongodb and can't find the solution. I'm using mongo-php-driver I just
I need to provide a way that my mongodb server will store each document
I need to run MongoDB with node.js both locally, and on cloud services such

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.