环境

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

php extension memcache and memcached module on centos6的更多相关文章

  1. centos6 php7 安装 memcache 和 memcached

    下载安装memcache 注意:官网的memcache包,暂时好像不支持php7.所以到下面地址下载memcache包,切换到php7分支 php7 memcache github 下载地址 官网下载 ...

  2. memcache与memcached介绍及安装配置

    也许大家一看到Memcache和Memcached会有点晕,这两者有什么关系又有什么区别呢,下面先给大家说下Memcached,Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应 ...

  3. memcache与memcached扩展的区别

    一.服务端 之前理解错误了.服务端只有一个memcache,一般把服务端称作memcached(带d),是因为守护进程的名称就是叫做memcached(一个这样的执行程序文件). 编写的语言:c语言 ...

  4. memcached的安装以及php两个扩展软件安装(memcache、memcached)

    百度云安装包:http://pan.baidu.com/s/1pKZeDwn  k3ap 1.安装memcached Memcached是基于libevent的事件处理,所以它的安装依赖libeven ...

  5. 【Linux】memcache和memcached的自动安装

    赶时间所以写一个简单的一个脚本,没有优化,想优化的可以学习下shell,自己优化下. 且行且珍惜,源码包+脚本领取处 链接:https://pan.baidu.com/s/1wIFR1wY-luDKs ...

  6. PHP 7 安装 Memcache 和 Memcached 总结

    Memcache 与 Memcached 的区别 Memcached 是 Memcache 的升级版,优化了 Memcache,并增加了一些操作方法.所以现在基本都是用最近版本的. PHP 7 下安装 ...

  7. 安装php扩展模块参数memcache和memcached在php中的应用

    一, memcache和memcached的区别与关系统php要想去访问memcached就得需要memcache扩展,这个道理和php连接mysql一样. 你不安装memcache扩展就没法识别me ...

  8. PHP之Memcache和Memcached

    本篇文章向大家介绍的是PHP中的Memcache和Memcached ,有兴趣的朋友可以看一下 **Memcache介绍:**Memcache是一套分布式缓存系统,分布式就是说可以在多台服务器上同时安 ...

  9. PHP7 下安装 memcache 和 memcached 扩展

    转载自:https://www.jianshu.com/p/c06051207f6e Memcached 是高性能的分布式内存缓存服务器,而PHP memcache 和 memcached 都是 Me ...

随机推荐

  1. thinkphp几个表的数据合并,并用数组分页

    控制器: //金币扣除 public function jbkc(){ $map['UG_dataType']= 'xtkc'; $list1 = M ( 'userget' )->where ...

  2. yii2.0 的数据的 改

    修改数据 /**     * 根据获取到的数据的id 去编辑对应的数据  controller层     */ //引入对应的model use app\models\About; //定义一个方法 ...

  3. AC自动机+全概率+记忆化DP UVA 11468 Substring

    题目传送门 题意:训练指南P217 分析:没有模板串也就是在自动机上走L步,不走到val[u] == v的节点的概率 PS:边读边insert WA了,有毒啊! #include <bits/s ...

  4. iOS学习01C语言数据类型

    1.注释 // 单行注释 // 注释对代码起到解释说明的作用,注释是给程序员看的,不参与程序运行 /*  多行注释  Xcode快捷键  全选 cmd+a  复制 cmd+c  粘贴 cmd+v  设 ...

  5. BZOJ4538 : [Hnoi2016]网络

    求出这棵树的dfs序,对于一条链$u-v$,假设$st[u]\leq st[v]$,那么一条链不经过点$x$当且仅当它满足下面任意一个条件: 1.$st[v]<st[x]$ 2.$st[u]&g ...

  6. BZOJ3542:DZY Loves March

    询问是要求 $\sum_{i=1}^n((x[i]-a)^2+(y[i]-b)^2)(x[i]=a||y[i]=b)$ 即求 $\sum_{i=1}^n(x[i]-a)^2(y[i]=b)+\sum_ ...

  7. [WP8.1UI控件编程]Windows Phone自定义布局规则

    3.2 自定义布局规则 上一节介绍了Windows Phone的系统布局面板和布局系统的相关原理,那么系统的布局面板并不一定会满足所有的你想要实现的布局规律,如果有一些特殊的布局规律,系统的布局面板是 ...

  8. 【BZOJ】2237: [NCPC2009]Flight Planning

    题意 \(n(1 \le n \le 2500)\)个点的树,求删掉一条边再加上一条边使得还是一棵树,且任意两点最大距离最小. 分析 考虑枚举删掉每一条边,我们只需要考虑如何加边容易求得新树的最大距离 ...

  9. 【BZOJ1503】 [NOI2004]郁闷的出纳员 splay

    splay模板题,都快把我做忧郁了. 由于自己调两个坑点. 1.删除时及时updata 2.Kth 考虑k满足该点的条件即r->ch[1]->size+1<=k && ...

  10. 【BZOJ2821】作诗(Poetize) 分块

    Description 神犇SJY虐完HEOI之后给傻×LYD出了一题:SHY是T国的公主,平时的一大爱好是作诗.由于时间紧迫,SHY作完诗之后还要虐OI,于是SHY找来一篇长度为N的文章,阅读M次, ...