One, Centos6.5 yum install php memcache extension Search Memcacheyum search memcache have, now can install Yum -y install memcached memcached-devel php-pecl-memcache Verify the installation results memcached -hphp -m|grep memcache Start memcached/sbin/servive memcached start test <?php$mem = new Memcache, $mem->connect ("127.0.0.1", 11211); $mem->set (' key1 ', ' this is first Value ', 0, 60); $val = $mem->get (' Key1 '); Var_dump ($val); II, centos6.5 Compile and install install PHP memcache extensions Instructions: PHP installation directory:/usr/local/php5php.ini profile path:/usr/local/php5/etc/php.ininginx installation directory:/usr/ Local/nginxnginx Web site root:/USR/LOCAL/NGINX/HTML1, installing the compilation tool yum install wget make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils PATCH&NBSP;PERL2, installing memcachecd /usr/local/src #进入软件包存放目录wget http://pecl.php.net/get/ memcache-2.2.6.tgz #下载tar zxvf memcache-2.2.6.tgz #解压cd memcache-2.2.6 #进入安装目录/usr/local/php5/bin/ phpize #用phpize生成configure配置文件./configure --with-php-config=/usr/local/php5/bin/ php-config #配置 make #编译make install #安装安装完成之后, the following interface appears, remember the path below, which will be used later. /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/ #memcache模块路径3, configure PHP support Memcachevi /usr/local/php5/etc/php.ini #编辑配置文件, add the following on the last line extension= "memcache.so" 4, Test vi /usr/local/ nginx/html/phpinfo.php #编辑 <?phpphpinfo ();? >wq! #保存退出service php-fpm restart #重启php-fpmservice nginx restart #重启nginx浏览器打开phpinfo .php as shown, you can see Memcache related information
Linux CentOS installation php memcache extension