php extension memcache and memcached module on centos6
2016-01-08 13:47
645 查看
环境
centos6
php5.6
nginx 1.8
防火墙均关闭
我在这里简单描述一下过程
Change nginx configuration file support php
Change php-fpm configuration file(sock)
test nginx and php
If the test page ok,php and nginx is good.
#=========================install memcache extension==================================
restart nginx php-fpm
find memcache on test page or php -m
#===========================memcached===============================================
wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz
wget http://pecl.php.net/get/memcached-2.2.0.tgz
ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
-rwxr-xr-x 1 root root 335433 1月 8 12:37 memcached.so
-rw-r--r-- 1 root root 259968 1月 8 11:32 memcache.so
-rwxr-xr-x 1 root root 1104016 1月 8 10:28 opcache.a
-rwxr-xr-x 1 root root 585616 1月 8 10:28 opcache.so
restart php nginx .don't forget chmod php-cgi.sock
author:V
centos6
php5.6
nginx 1.8
防火墙均关闭
我在这里简单描述一下过程
#install nginx yum -y install pcre pcre-devel openssl opensll-devel gcc* #only mini install centos6 adduser www ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module make ; make install #install php5.6 yum install -y zlib-devel fontconfig fontconfig-devel libXpm* libtool* libxml2 libxml2-devel curl curl-devel ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd make ; make install cd /usr/local/php/etc cp php-fpm.conf.default php-fpm.conf
Change nginx configuration file support php
#There is only a change of content. vim /usr/local/nginx/conf/nginx.conf user www; location ~ \.php$ { root html; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name; include fastcgi_params; }
Change php-fpm configuration file(sock)
#There is only a change of content. vim /usr/local/php/etc/php-fpm.conf user = www group = www ;listen = 127.0.0.1:9000 listen = /dev/shm/php-cgi.sock
/usr/local/php/sbin/php-fpm #start php-fpm chmod 777 /dev/shm/php-cgi.sock /usr/local/nginx/sbin/nginx #start nginx
test nginx and php
cat >> /usr/local/nginx/html/info.php << EOF <?php phpinfo(); ?> EOF
If the test page ok,php and nginx is good.
#=========================install memcache extension==================================
/usr/local/php/bin/pecl install memcache #auto install memcache module cd /usr/local/php/bin/php --ini #find php.ini file directory. my php.ini file directory is /usr/local/php/lib . or open test page info.php search "php.ini". echo "extension=memcache.so" >> /usr/local/php/lib/php.ini /usr/local/php/bin/php -m #see php load module
restart nginx php-fpm
killall nginx /usr/local/nginx/sbin/nginx ps -ef |grep php-fpm #mark PID kill -INT PID /usr/local/php/sbin/php-fpm
find memcache on test page or php -m
#===========================memcached===============================================
wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz
wget http://pecl.php.net/get/memcached-2.2.0.tgz
./configure --prefix=/usr/local/libmemcached --with-memcached make ; make install cd memcached-2.2.0 /usr/local/php/bin/phpize ./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl make ; make install
ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
-rwxr-xr-x 1 root root 335433 1月 8 12:37 memcached.so
-rw-r--r-- 1 root root 259968 1月 8 11:32 memcache.so
-rwxr-xr-x 1 root root 1104016 1月 8 10:28 opcache.a
-rwxr-xr-x 1 root root 585616 1月 8 10:28 opcache.so
echo "extension=memcached.so" >> /usr/local/php/lib/php.ini
restart php nginx .don't forget chmod php-cgi.sock
author:V
相关文章推荐
- memcached启动与清理缓存
- memcache数据组织
- memcache细节解析
- 分布式缓存-Memcached
- memcached安装
- memcached命令和配置
- 负载均衡与集群之nginx+tomcat+memcached
- NGINX + TOMCAT7 + MEMCACHED 实现SESSION 共享
- xmemcached详解
- 初窥InnoDB的Memcached插件
- memcached libmemcached 下载安装
- memcache-session-manager(flexjson)
- Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.0 + Mariadb 10.1.9 + Nginx 1.9.9 + PHP 7.0.2)
- Ehcache和MemCached区别及应用
- redis memcached mongodb ,couchbase, couchdb,memcache ,HDInsight,documentdb,Greenplum,Nosql,
- Memcached CAS协议 通过版本号,防止多线程修改错误
- Memcached 配置 和项目应用
- 使用Memcached Session Manager扩展Session管理
- Memcached的安装和使用
- memcache共享session