centos安装memcached和PHP php-pecl-memcached.x86_64
安装memcached
sudo yum install memcached.x86_64
安装php-pecl-memcached
php memcache有两个实现类
php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon
php-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon
我们需要装
sudo yum install php-pecl-memcached.x86_64
否则,在PHP中会报错
Fatal error: Class 'Memcache' not found
启动memcached并测试php
sudo service memcached stop
sudo service memcached start
新建php-mem.php
<?php
$mem = new Memcache;
$mem->connect("localhost", 11211);
$mem->set('ryan', 'Miao', 0, 60);
$ryan = $mem->get('ryan');
echo $ryan;
?>
执行
php php-memcache.php
Miao
centos安装memcached和PHP php-pecl-memcached.x86_64的更多相关文章
- centos 安装mysql Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm rpm -ivh mysql-community-release ...
- Centos安装Memcached和(Nginx)Memcache扩展详细教程
下载memadmin,下载地址:http://www.junopen.com/memadmin/ 并在IIS新建站点. 测试地址:http://wap.yousawang.com/mem , 1.重启 ...
- 【转】centos安装memcached+php多服务器共享+session多机共享问题
参考博文: centos安装memcached 源码安装 Yum安装Memcache Memcached内存分配优化及使用问题 <转>php+memcached 实现session共享 P ...
- centos 安装 memcached
centos 安装 memcached 1. 安装依赖: libeventyum install libevent-devel 2. 获取最新版本wget http://memcached.org/l ...
- CentOS安装memcached及配置php的memcache扩展
遇到的问题: 这个问题主要是linux服务器安装memcached服务后,phpinfo信息没有memcache扩展,所以主要是给php安装memcache扩展,教程中是安装memcache扩展,我认 ...
- CentOS安装Memcached
安装&配置 wget http://memcached.org/latest -O memcached.tar.gz tar -zxvf memcached.tar.gz cd memcach ...
- memcached----------linux下安装memcached,以及php的memcached扩展。
1.通过wget http://www.memcached.org/files/memcached-1.4.24.tar.gz下载最新源码2.解压tar -xf memcached-1.4.24.ta ...
- yum 安装apache php 使php支持memcached扩展
在公司上新项目的时候,无论生产环境还是测试环境,都会让运维安装php 环境(lamp/lnmp),并让php支持memcached 的扩展.这里搭建php环境其实主要就是搭建apache 和php.m ...
- Memcached的安装和使用以及nginx整合memcached
一.模块的安装启动 wget http://cdnetworks-kr-2.d1.sourceforge.net/project/levent/libevent/libevent-2.0/libeve ...
- centos 安装pecl
一.更新yum源,安装php7 CentOS/RHEL 7.x: 1 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-lates ...
随机推荐
- CCF2014032窗口(C语言)
问题描述 在某图形操作系统中,有 N 个窗口,每个窗口都是一个两边与坐标轴分别平行的矩形区域.窗口的边界上的点也属于该窗口.窗口之间有层次的区别,在多于一个窗口重叠的区域里,只会显示位于顶层的窗口里的 ...
- 【hadoop】python通过hdfs模块读hdfs数据
hdfs官网:http://hdfscli.readthedocs.io/en/latest/api.html 一个非常好的博客:http://blog.csdn.net/gamer_gyt/arti ...
- Codeforces 999F Cards and Joy(二维DP)
题目链接:http://codeforces.com/problemset/problem/999/F 题目大意:有n个人,n*k张卡牌,每个人会发到k张卡牌,每个人都有一种喜欢的卡牌f[i],当一个 ...
- hdu5672 尺取
因为没有初始化ans搞了一晚上 还是尺取,枚举所有l 然后寻找对应满足条件的r,这个串可以被后面所有的串包含,所以每个l 的贡献就是len-r+1 #include<bits/stdc++.h& ...
- python 全栈开发,Day127(app端内容播放,web端的玩具,app通过websocket远程遥控玩具播放内容,玩具管理页面)
昨日内容回顾 1. 小爬爬 内容采集 XMLY 的 儿童频道 requests 2. 登陆 注册 自动登陆 退出 mui.post("请求地址",{数据},function(){} ...
- 第一个Struts2实例之hello world!
Struts官网:http://struts.apache.org/ Struts2框架预先实现了一些功能 1:请求数据自动封装 2:文件上传的功能 3:对国际化功能的简化 4 ...
- ActiveMQ的应用实例
一.部署和启动ActiveMQ 去官网下载:http://activemq.apache.org/ 我下载的是apache-activemq-5.12.0-bin.tar.gz, 解压到本地目录,进入 ...
- STM32的HAL库中的DMA_FLAG_TCIF3_7等几个宏定义的含义
DMA_FLAG_TCIF0_4就是指DMA的通道0和通道4,DMA_FLAG_TCIF1_5就是指DMA的通道1和通道5,DMA_FLAG_TCIF2_6就是指DMA的通道2和通道6,DMA_FLA ...
- MooFest POJ1990
题意: 一群牛参加完牛的节日后都有了不同程度的耳聋,第i头
- 【Java】 剑指offer(9) 斐波那契数列及青蛙跳台阶问题
本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集 题目 写一个函数,输入n,求斐波那契(Fibonacci)数列的第n项 ...