2020-01-16 PHP7 扩展memcache

一、php安装
1.下载、解压及编译安装
wget http://cn2.php.net/distributions/php-7.1.0.tar.gz

tar zxvf php-7.1.0.tar.gzcdphp-7.1.0

./configure --prefix=/Data/apps/php --with-config-file-path=/Data/apps/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash--enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

make && make install
二、memcache

1、yum install git -y
2、memcache

[root@iz2ze4jq06yojn4f8bm98kz src]# cd pecl-memcache/
[root@iz2ze4jq06yojn4f8bm98kz pecl-memcache]# ls
cloudbuild.yaml  config.m4   CREDITS  Dockerfile   LICENSE       package.xml  profile.php  tests
config9.m4       config.w32  docker   example.php  memcache.php  php7         README
[root@iz2ze4jq06yojn4f8bm98kz pecl-memcache]# /usr/local/webserver/php_7.1.0/bin/phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[root@iz2ze4jq06yojn4f8bm98kz pecl-memcache]# ./configure --with-php-config=/usr/local/webserver/php_7.1.0/bin/php-config
[root@iz2ze4jq06yojn4f8bm98kz pecl-memcache]# make && make install
[root@iz2ze4jq06yojn4f8bm98kz pecl-memcache]# cd /usr/local/webserver/php_7.1.0/lib/
[root@iz2ze4jq06yojn4f8bm98kz lib]# vim php.ini 
[root@iz2ze4jq06yojn4f8bm98kz lib] pkill -9 php
[root@iz2ze4jq06yojn4f8bm98kz lib] cd ../
[root@iz2ze4jq06yojn4f8bm98kz php_7.1.0]  ./sbin/php-fpm

php.ini里加
extension=/usr/local/webserver/php_7.1.0/php/extensions/no-debug-non-zts-20160303/memcache.so

你可能感兴趣的:(2020-01-16 PHP7 扩展memcache)