Andy's Blog » centos mongo, centos pecl, yum php_mongo, yum mongo php, pecl, centos yum mongo so, yum php_mongo扩展, centos mongo php 驱动哪里下载, yum php54 mongo, yum php-mongo php-memcached, yum mongo » CentOS yum 安装 Mongo + PHP

CentOS yum 安装 Mongo + PHP

昨天怎么搞都有问题,今天终于装成功了,记录一下

前奏请参考我的《1分钟完美安装最新 CentOS + Nginx + PHP-FPM + MySQL》教程

直接给脚本,不说话

CentOS yum 安装 Mongo + PHP


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

转载请注明原文出处 http://www.21andy.com/new/20120603/2053.html

Incoming search terms:

Tags: centos, PHP, mongo, pecl, yum

本文地址: http://www.21andy.com/new/20120603/2053.html