Reputation: 91
In PHP how to check if the CORRECT mongodb PHP driver is installed for the corresponding mongodb.
The link below tells how to check if mongodb PHP driver is installed, but does not tell if that driver is correct/compatible for the corresponding mongodb.
http://stackoverflow.com/questions/11134959/check-if-mongodb-php-driver-is-installed
For example, if I have PHP version 5.3.10 and have mongodb 2.2.2, the command
echo extension_loaded("mongo") ? "loaded\n" : "not loaded\n";
will say loaded, however, mongodb is not going to work properly because for mongodb 2.2.2, you need the latest PHP not 5.3.10
Upvotes: 1
Views: 1976
Reputation: 646
I think, you're talking about driver, not PHP itself. PHP has no built-in support to access \Mongo*
classes until you compile and load special extension.
Since you're talking about the latest version of MongoDB, I think you couldn't use some parts of its functionality because you had some old driver (say, 1.2.12). When you upgraded PHP, you, probably, updated the driver to the latest (1.3.0) stable version as well. That version of driver was submitted a couple of days ago, and it supports all the latest features MongoDB provides.
Anyway, if you'd like to check which version of driver you have, you can call phpinfo(8)
from your PHP and look though the output for the mongo section, where the version of driver is displayed.
Upvotes: 1