I.
I’m new on mongodb, it seems cool.
For security reason I configured mongod to launch with auth = true.
Now, according to http://www.mongodb.org/pages/viewpage.action?pageId=589836, authentication §,
To access administrative functions, you must use MongoAuth (logged in
to a specific database) or MongoAdmin (root access to all databases).
These are not included in the built-in PHP extension, so you must
include or require the files Admin.php and Auth.php. They are in the
downloaded source under php/Mongo/. Assuming you have php/ on your
include path, you can say:include "Mongo/Admin.php"; ...
I’ve searched in /var/share/php, /var/share/php/PEAR, and no Admin nor Auth.php found…
- Are these files included in a common PEAR install ?
(assuming a common install issudo pecl install mongo) - If no, how to install them ?
Thanks
I think you are confused about authentication.
By default Mongo with or without these added classes will log you in as an authenticated user.
The classes you reference to are Administration and Server control classes. They give effectively root access to everything.
Just adding a username and password to your MongoDB connection string to auth will do good enough, you don’t need those classes. An example:
And that will initiate the default authentication within the PHP driver.