mongodb安装

/ 0评 / 1

安装配置

#wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.1.tgz
#tar -zxvf mongodb-linux-x86_64-3.2.1.tgz
#mkdir mongodata
#mv mongodb-linux-x86_64-3.2.1/bin mongodata
#mkdir log
#mkdir data
#mkdir conf
#vi conf/mongod.conf

写入保存:

port = 27017
dbpath = data
logpath = log/mongod.log
fork = true #后台运行

运行服务:

./bin/mongod -f conf/mongod.conf

客户端连接

./bin/mongo

下载php扩展

wget https://github.com/mongodb/mongo-php-driver-legacy/archive/master.zip
unzip master.zip
cd mongo-php-driver-legacy-master

安装php扩展

phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
sudo make install