Description
PHP installation directory:/usr/local/php
PHP.ini configuration file path:/usr/local/php/etc/php.ini
Nginx installation directory:/usr/local/nginx
Nginx website root directory:/usr/local/nginx/html
1, installation Memcache
Cd/root #进入软件包存放目录
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/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following interface appears, remembering the following paths, which are used later.
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ #memcache模块路径
2. Configure PHP support Memcache
Vi/usr/local/php/etc/php.ini #编辑配置文件, add the following on the last line
extension= "Memcache.so"
3. Testing
vi/usr/local/nginx/html/phpinfo.php #编辑
<?php
Phpinfo ();
?>
wq! #保存退出
Service php-fpm Restart #重启php-fpm
Service Nginx Restart #重启nginx
This article is from the "Chuncoquan" blog, make sure to keep this source http://kequan.blog.51cto.com/10815369/1758336
PHP installation memcache extension under Linux