首页 > Linux > CentOS yum 安装 Mongo + PHP
2012
11-08

CentOS yum 安装 Mongo + PHP

CentOS yum 安装 Mongo + PHP - 第1张  | 技术人生-孙强

下载: mongo_php.sh
#!/bin/bash

# install repo
if [ `getconf WORD_BIT` = ’32’ ] && [ `getconf LONG_BIT` = ’64’ ] ; then
cat >/etc/yum.repos.d/10gen-mongodb.repo<<ANDYANDY
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
ANDYANDY
else
cat >/etc/yum.repos.d/10gen-mongodb.repo<<ANDYANDY
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
gpgcheck=0
ANDYANDY
fi

# install mongod
yum -y install mongo-10gen mongo-10gen-server
chkconfig –levels 235 mongod on

# install php-pecl-mongo
yum -y install make gcc php-devel
pecl search mongo
pecl install mongo
echo ‘extension = mongo.so’ > /etc/php.d/mongo.ini

# iptables rule
echo ‘-A INPUT -m state –state NEW -m tcp -p tcp –dport 27017 -j ACCEPT’ >> /etc/sysconfig/iptables

最后编辑:
作者:sunny5156
喜欢技术....

留下一个回复