I have Laravel 4 installed on WAMP and it works great with a MySQL backend.
I have successfully setup second virtual host and would like to use a MongoDB
backend. After searching around I found out that Laravel does not natively connect to MongoDB and I found https://github.com/jenssegers/Laravel-MongoDB and I have been trying to set it up but I can't seem to get it right. Obviously I must be doing something wrong and I am hoping someone can help me identify what it is that I am not doing right.
I edited composer.json
per the instructions:
............
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"jenssegers/mongodb": "*"
},
"autoload": {
.........
Then I ran composer update
. It installed monolog 1.9.1 and swiftmailer v5.2.0 - whatever these are - successfully (a few days ago) but then threw an error after that. Today I tried to run composer update
again, and it updated the two to 1.10.0 and v5.2.1 respectively and then encountered the same error. Now when I try composer update
it consistently throws the same error:
Nothing to install or update
Generating autoload files
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","me
ssage":"Class 'MongoClient' not found","file":"C:\\wamp\\www\\laravel\\vendor\\j
enssegers\\mongodb\\src\\Jenssegers\\Mongodb\\Connection.php","line":132}}Script
php artisan clear-compiled handling the post-update-cmd event returned with an
error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
[--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-
dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [
packagesN]
What I have tried:
I have downloaded and installed the php_mongo.dll by placing it in the php ext folder and enabling it in php.ini:
; added for mongoDB connections
extension=php_mongo.dll
But this did not help.