php用的是5.6.9版本,使用的wdcp进行操作的,其他的都没问题,就只有Memcache没有安装好,有没有大神可以给个教程或者是指令安装的代码之类的。
引用第4楼gnuhacker于2015-12-06 11:32发表的 回 3楼(手拍客) 的帖子 :
感觉文件系统的cache已经够用了,用memory的cache占用内存,而且配置复杂,费用高.
tar zxvf memcached-x.x.x.tgz
cd memcached-x.x.x
/php安装路径/php/bin/phpize
./configure --enable-memcached --with-php-config=/php安装路径/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
make && make install
chkconfig --add memcached
chkconfig --level 35 memcached on
service memcached start
#!/bin/sh
#
# Startup script for the server of memcached
# processname: memcached
# pidfile: /usr/local/memcached/memcached.pid
# logfile: /usr/local/memcached/memcached_log.txt
# memcached_home: /etc/memcached
# chkconfig: 35 21 79
# description: Start and stop memcached Service
# Source function library
. /etc/rc.d/init.d/functions
RETVAL=0
prog="memcached"
basedir=/usr/local/memcached
cmd=${basedir}/bin/memcached
pidfile="$basedir/${prog}.pid"
#logfile="$basedir/memcached_log.txt"
ipaddr="127.0.0.1"
port="11211"
username="root"
max_memory=512
max_simul_conn=1024
#maxcon=51200
#growth_factor=1.3
#thread_num=6
#verbose="-vv"
#bind_protocol=binary
start() {
echo -n $"Starting service: $prog"
$cmd -d -m $max_memory -u $username -l $ipaddr -p $port -c $max_simul_conn -P $pidfile
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
}
stop() {
echo -n $"Stopping service: $prog "
run_user=`whoami`
pidlist=`ps -ef | grep $run_user | grep memcached | grep -v grep | awk '{print($2)}'`
for pid in $pidlist
do
# echo "pid=$pid"
kill -9 $pid
if [ $? -ne 0 ]; then
return 1
fi
done
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
#reload)
# reload
# ;;
restart)
stop
start
;;
#condrestart)
# if [ -f /var/lock/subsys/$prog ]; then
# stop
# start
# fi
# ;;
status)
status memcached
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
tar xvf memcache-x.x.x.tgz
cd memcache-x.x.x
/php安装路径/php/bin/phpize
./configure --with-php-config=/php安装路径/php/bin/php-config --with-zlib-dir --enable-memcache
make && make install
-------------------------
-------------------------
ruby on rails的cache机制下, 两者可以互换
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。