CentOS6.9源码编译安装php-memcached扩展

安装memcached请移步以下地址:
CentOS6.9源码编译安装memcached
CentOS6.9yum安装memcached和php-memcached扩展
php安装请移步以下地址:
CentOS6.9源码编译安装nginx+php7+mysql环境
CentOS6.9yum安装nginx+php7+mysql环境
1.安装libmemcached

新建并进入源码保存目录

mkdir -p /usr/local/src
cd /usr/local/src

下载,解压

wget -c https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
tar -zxvf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18

配置,编译,安装

#安装依赖
yum -y install gcc gcc-c++
./configure --prefix=/usr/local/libmemcached --with-memcached
make -j4
make install

2.安装memcached

进入源码保存目录,下载,解压

wget -c http://pecl.php.net/get/memcached-3.1.3.tgz
tar -zxvf memcached-3.1.3.tgz
cd memcached-3.1.3

3.生成configure文件

/usr/local/php72/bin/phpize#这是我的phpize的位置

4.配置,编译,安装

./configure --with-php-config=/usr/local/php72/bin/php-config  --with-libmemcached-dir=/usr/local/libmemcached --enable-memcached --disable-memcached-sasl
make -j4
make install

5.将memcached扩展加入php.ini

echo "extension=memcached.so" >> /usr/local/php72/etc/php.ini

6.重启php,查看phpinfo();
CentOS6.9源码编译安装php-memcached扩展_第1张图片
原文地址:https://www.jmsite.cn/blog-227.html

你可能感兴趣的:(php,memcached,数据库)