yum安装memcache,mongo扩展以及python的mysql模块安装

//启动memcached
/usr/local/memcached/bin/memcached -d -c 10240 -m 1024 -p 11211 -u root
/usr/local/memcached/bin/memcached -d -c 10240 -m 1024 -p 11212 -u root


1、安装mongodb

mongodb安装在/usr/local/mongod 目录下
mkdir /usr/local/mongod/data //存放数据,
touch /usr/local/mongod/logs //存放log


//启动mongo服务
/usr/local/mongod/bin/mongod --dbpath=/usr/local/mongod/data --logpath=/usr/local/mongod/logs --logappend --port=27017 --fork


2、安装php的mongo扩展,这里需要重启php-fpm
(若没有安装phpize,则需要:yum install php-devel)
yum -y install php-pecl-mongo
pecl install mongo
在php.ini中添加extension=mongo.so

vim /etc/php.ini 增加extension=mongo.so
/etc/rc.d/init.d/php-fpm restart


3、安装python的mysql模块
yum install python-setuptools(如果没有)
easy_install pip
yum -y install python-devel mysql-devel ##libxml2 libxml2-dev libxslt* zlib gcc openssl
pip install MySQL-python

#vim ./site.cfg
#第13行 修改为:mysql_config=/usr/bin/mysql_config
#python setup.py build
#python setup.py install

4、安装python的pymongo模块
pip install pymongo


安装memcache扩展
yum install libevent libevent-devel
yum -y install php-pecl-memcache
pecl install memcache
在php.ini中添加extension=memcache.so
/etc/rc.d/init.d/php-fpm restart

 

你可能感兴趣的:(yum安装memcache,mongo扩展以及python的mysql模块安装)