Home > Database > Mysql Tutorial > body text

Lnmp安装MongoDB以及PHP扩展

WBOY
Release: 2016-06-07 16:31:13
Original
1025 people have browsed it

MongoDB安装 wget -c http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.1.tgz tar zxvf mongodb-src-r2.4.1.tar.gz mv mongodb-linux-i686-2.4.1 /usr/local/mongodb//usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/ --logpath=/u

MongoDB安装

wget -c  http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.4.1.tgz                 
tar zxvf mongodb-src-r2.4.1.tar.gz                 
mv mongodb-linux-i686-2.4.1 /usr/local/mongodb/
/usr/local/mongodb/bin/mongod --dbpath=/usr/local/mongodb/data/ --logpath=/usr/local/mongodb/dblogs --fork
Copy after login

启动以后可以查看mongodb进程树

pstree -p |grepmongod
Copy after login

PHP MongoDB 扩展

wget http://pecl.php.net/get/mongo-1.3.6.tgz             
/usr/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
/usr/local/php/etc/php.ini             
extension=mongo.so;
Copy after login

关闭注意
这里禁止使用 kill -9 PID 关闭mongodb进程,会导致mongod.lock导致再一次无法开启mongodb,必须删除mongod.lock再能开启
可以使用pkill mongod 或者 killall mongod 来结束mongodb进程

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!