I'm new to MongoDB and LampCMS and I faced problem during last stage of install. Can't create new (first) user. After filling "Username", "E-mail" and "Captcha" and pressing "Register" button I reveive following error.
Alert Caught catchable fatal error in file: /var/www/html/LampCMS/lib/Lampcms/Mongo/DB.php on line: 226 Error message: Argument 2 passed to MongoCollection::insert() must be an array, boolean given, called in /var/www/html/LampCMS/lib/Lampcms/Mongo/Doc.php on line 555 and defined error code: 1 file: /var/www/html/LampCMS/!inc.php line: 177 Trace: #0 (): LampcmsErrorHandler(4096, 'Argument 2 passed to MongoCollection::insert() must be an array, boolean given, called in /var/www/html/LampCMS/lib/Lampcms/Mongo/Doc.php on line 555 and defined', '/var/www/html/LampCMS/lib/Lampcms/Mongo/DB.php', 226, Array) #1 /var/www/html/LampCMS/lib/Lampcms/Mongo/DB.php(226): insert(Array, true) #2 /var/www/html/LampCMS/lib/Lampcms/Mongo/Doc.php(555): insertData('USERS', Array) #3 /var/www/html/LampCMS/lib/Lampcms/Mongo/Doc.php(472): insert() #4 /var/www/html/LampCMS/lib/Lampcms/Controllers/Register.php(258): save() #5 /var/www/html/LampCMS/lib/Lampcms/Controllers/Register.php(180): createNewUser() #6 /var/www/html/LampCMS/lib/Lampcms/WebPage.php(272): main() #7 /var/www/html/LampCMS/www/index.php(89): __construct(Lampcms\Registry)Apache and MongoDB logs are silent on this action.
My system is CentOS release 5.5 running inside OpenVZ container. I saw the message in MongoDB log, which says that it will cause errors while running it inside OpenVZ, but I decided to give it a chance.
What do think, what can cause this error?
Thank you. This is interesting, looks like the API for this mongoCollection may have changed since I wrote the class. I mean, there has been several updates to php's Mongo library since then.
Originally it was possible to pass 'true' to MongoCollection insert method as second parameter, meaning a 'safe' mode, meaning to write data to disk immediately.
Indeed, looking a the latest documentation on php.net site it does say that second param cannot be boolean anymore.
I will make update now and will commit the update to github ASAP.