In the previous post, I posted about how to install the MongoDB driver for PHP. Apparently, most problems occur when installing mongoDB. There are many ways to install mongoDB in Ubuntu, but I recommend you to use aptitude because you do not need to configure anymore. Just install and run the service.
When I installed mongoDB on Ubuntu 10.04, there are some problems :
1. I found this message mongoDB Pls starting the server.
mongod: symbol lookup error: mongod: undefined symbol:
JS_SetCStringsAreUTF8
2. Then, I found an error message again, whereas the no.1 problem was solved.
exception in initAndListen std:: exception: Unable to create / open lock file for lockfilepath: / data / db / mongod.lock, terminating
Ok, how to fix that problems?
For no.1 problem :
JS_SetCStringsAreUTF8 error associated with SpiderMonkey. It is installed on your Ubuntu, but crash accured.
To solve this problem, you need to install the stable version of mongoDB.
Add this source to your sources.list
deb http://downloads.mongodb.org/distros/ubuntu 10.4 10gen
$sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 $ sudo apt-get update $sudo sudo apt-get install mongodb-stable
This problem should have been solved.
The no.2 problem, it happened because mongoDB stopped improperly, to fix this problem just run the following command :
$sudo rm /data/db/mongod.lock $sudo mongod -repair
Run mongod as root
$sudo su #mongod
To test your mongoDB server, open the mongoDB shell :
$mongo
