php7 memcached 安装,PHP7 安装 Memcached

PHP版本:PHP 7.3.16

LINUX版本:7.6

安装成功的样子:

php -r "phpinfo();" | grep memcached

memcached

memcached support => enabled

libmemcached version => 1.0.16

memcached.compression_factor => 1.3 => 1.3

memcached.compression_threshold => 2000 => 2000

memcached.compression_type => fastlz => fastlz

memcached.default_binary_protocol => Off => Off

memcached.default_connect_timeout => 0 => 0

memcached.default_consistent_hash => Off => Off

memcached.serializer => php => php

memcached.sess_binary_protocol => Off => Off

memcached.sess_connect_timeout => 0 => 0

memcached.sess_consistent_hash => On => On

memcached.sess_consistent_hash_type => ketama => ketama

memcached.sess_lock_expire => 0 => 0

memcached.sess_lock_max_wait => not set => not set

memcached.sess_lock_retries => 5 => 5

memcached.sess_lock_wait => not set => not set

memcached.sess_lock_wait_max => 150 => 150

memcached.sess_lock_wait_min => 150 => 150

memcached.sess_locking => On => On

memcached.sess_number_of_replicas => 0 => 0

memcached.sess_persistent => Off => Off

memcached.sess_prefix => memc.sess.key. => memc.sess.key.

memcached.sess_randomize_replica_read => Off => Off

memcached.sess_remove_failed_servers => Off => Off

memcached.sess_sasl_password => no value => no value

memcached.sess_sasl_username => no value => no value

memcached.sess_server_failure_limit => 0 => 0

memcached.store_retry_count => 2 => 2

Registered save handlers => files user memcache memcached

安装步骤:

# 首先需要安装libmemcached库

yum -y install libmemcached libmemcached-devel

# 下载memcached扩展,两个地址任选一

wget https://github.com/php-memcached-dev/php-memcached/archive/php7.zip

wget https://pecl.php.net/get/memcached-3.1.3.tgz

# 解压

unzip php7.zip

or

tar zxvf memcached-3.1.3.tgz

# 进入到解压后目录

# 准备安装

export PHP_AUTOCONF=/usr/bin/autoconf

export PHP_PREFIX=/opt/php

/usr/local/php/bin/phpize

# 配置

./configure --with-php-config=/opt/php/bin/php-config

make

make install

# 在php.ini中添加memcached扩展

extension=memcached.so

# 可以使用下面二种方式中的一种(具体看php的安装方式)

service php-fpm restart

systemctl reload php-fpm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值