一、安装mongodb
1、下载MongoDB 2.6.0二进制发行版 $ curl -O http://downloads.mongodb.org/linux/mongodb-linux-x86_64-2.6.0.tgz 2、解压MongoDB的压缩包 $ tar zvxf mongodb-linux-x86_64-2.6.0.tgz 3、简化目录名 $ mv mongodb-linux-x86_64-2.6.0 /usr/local/mongodb 4、创建数据库目录
$ mkdir /data/db
二、安装mongob扩展
tar zxvf mongodb-1.3.4.tgz cd mongodb-1.3.4 phpize ./configure --with-php-config=/usr/local/php/bin/php-config make && make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/ Installing header files: /usr/local/php/include/php/ vim /usr/local/php/etc/php.ini extension=/usr/local/php/lib/php/extensions/no-debug-zts-20131226/mongodb.so
问题解决:
(1)解决libc.so.6: version `GLIBC_2.14' not found问题
(2)解决/var/VMdisks/glibc-2.14/build/elf/ldconfig: Can't open configuration file /o
cp -r /etc/ld.so.c* /opt/glibc-2.14/etc/
ln -sf /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6
(3)解决libc.so.6: version `GLIBC_2.15' not found问题
(4)mongodb重启失败ERROR: child process failed, exited with error number 1
解决方法:
./bin/mongod --repair -f my.conf
参考博文: