the autoloader at the beginning of my php code
function __autoload($class_name) {
include_once $class_name . '.class.php';
}
is causing a call to new MongoClient(); to fail with the error Warning: include_once(MongoClient.class.php): failed to open stream
How can I use the autoloader for my classes and still use the standard classes?
Note: MongoDb has been installed with PECL and works fine with the autoloading function removed. mongo-1.3.0beta2 on php 5.4.9
PHP will not try to autoload anything that is in the stl (like PDO, mysqli, etc)
If MongoClient is not one of those types of classes, it will try to autoload it.
Make sure you have PECL installed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With