CentOS环境PHP安装memcache扩展
安装memcache
yum install memcached
安装libmemcached库
yum install libmemcached
PHP安装Memcache扩展
root@blog.phpha.com] wget -c http://pecl.php.net/get/memcache-3.0.8.tgz
[root@blog.phpha.com] tar -zxvf memcache-3.0.8.tgz
[root@blog.phpha.com] cd memcache-3.0.8
[root@blog.phpha.com] /usr/local/php/bin/phpize
[root@blog.phpha.com] ./configure -with-php-config=/usr/bin/php-config -with-zlib-dir
[root@blog.phpha.com] make && make install
#Installing shared extensions: /usr/lib64/php/modules/
#/usr/lib64/php/modules/memcache.so
[root@blog.phpha.com] vim /etc/php.ini
#extension = /usr/lib64/php/modules/memcache.so
[root@blog.phpha.com] service php-fpm reload
启动
memcached -d -u root -p 11211
测试:
<?php
$mem = new Memcache;
$mem->addServer("localhost",11211);
echo "Version:".$mem->getVersion();
class testClass{
private $str_attr;
private $int_attr;
public function __construct($str,$int)
{
$this->str_attr = $str;
$this->int_attr = $int;
}
public function set_str($str)
{
$this->str_attr = $str;
}
public function set_int($int)
{
$this->int_attr = $int;
}
public function get_str()
{
return $this->str_attr;
}
public function get_int()
{
return $this->int_attr;
}
}
$test = new testClass("hell world",1123);
$mem->set("key",$test,false,1000);
var_dump($mem->get("key"));
$test_array = array("index_1"=>"hello","index_2"=>"world");
$mem->set("array_test",$test_array,false);
var_dump($mem->get("array_test"));
?>
问题:
1.找不到php-config
find / -name php-config
2.找不到 ZLIB memcache support requires ZLIB
yum install zlib-devel
3.can't run as root without the -u switch
memecached -u root start
参考:
centos 为php安装memcache.http://blog.csdn.net/php_boy/article/details/6880488
CentOS环境PHP安装memcache扩展.http://blog.phpha.com/archives/1554.html
Centos安装Memcache.http://www.cnblogs.com/wubaiqing/archive/2011/09/19/2181602.html
CentOS环境PHP安装memcache扩展的更多相关文章
- win10 64位安装memcache扩展和开启redis扩展
前面有关于win10下搭建wamp环境的介绍,在此不在赘述,php操作memcache有memcache库和memcached库,其中memcache是php内置的扩展库,支持面向对象和面向过程两种操 ...
- linux下搭建lamp环境以及安装swoole扩展
linux下搭建lamp环境以及安装swoole扩展 一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源 我安装的环境是:apache2.2.15+mysql5 ...
- linux-CentOS6.4安装Memcached+memcached扩展+安装memcache扩展+Memcache+mecached同步SESSION的几种方法
一.编译环境的准备 yum install gcc yum install gcc-c++ libstdc++-devel yum install zlib-devel 二.源代码包准备 wget ...
- linux php 安装 memcache 扩展
1. memcached依赖于libevent,需要先安装libevent. tar zxvf libevent-2.0.21-stable.tar.gz cd libevent-2.0.21-sta ...
- phpStudy下安装memcache扩展
简要:参考<phpStydy配置memcache扩展>,期间安装不到memcache;为此向大家分享我遇到的问题和解决办法,希望能够跟各位PHP大神学习探索,如果有不对或者好的建议告知下: ...
- CentOS环境Docker安装教程(官方推荐的docker三种方式安装)
CentOS环境Docker安装教程(官方推荐的docker三种方式安装) 一.使用yum方式安装 1.安装依赖包 $ sudo yum install -y yum-utils device-map ...
- 安装memcached服务 和 php 安装memcache扩展
这是所有的命令,至于哪个命令是干嘛的自己悟去吧 ,顺便穿插一些知识点 安装libevent cd /home/ wget http://www.monkey.org/~provos/libeven ...
- CentOS下php安装mcrypt扩展
CentOS下php安装mcrypt扩展 Posted on 2012-09-12 15:27 C'est la vie 阅读(48294) 评论(3) 编辑 收藏 (以下步骤均为本人实际操作,可能与 ...
- php 安装Memcache扩展
转载地址:http://www.tuicool.com/articles/EB3imm 文章概述:由于当前机器安装的php,是用yum安装,现在需要使用到memadmin做一些监控, memadmin ...
随机推荐
- XP、Windows7下自动关机vbs脚本,使用windows计划任务+vbs脚本在XP、Windows7下实现定时自动关机
VBScript(Microsoft Visual Basic Script Edition).,微软公司可视化BASIC脚本版). 正如其字面所透露的信息, VBS(VBScript的进一步简写)是 ...
- IDEA使用笔记(三)——小齿轮的显示和隐藏(Autoscroll from Source)
在玩快捷键的时候,不清楚自己操作了什么,突然间发现——能直接定位到当前可编辑文件的哪个小齿轮,不见了,找了一会也没弄出来,从网上搜索吧!也没看到对应的方法,后来自己耐下心来复盘自己的操作,终于发现了, ...
- Oracle2MySQL注意事项
在Oracle切换成MySQL时,会碰到如下注意事项: Oracle中的sysdate在MySQL中是不支持的: Oracle中的分布方案在MySQL中的实现: Oracle中的SQL语句是大小写不敏 ...
- perl进程管理一例
#!/usr/bin/perl -w use strict; use warnings; use DBI; #### # 这里进行服务器任务管理 ## #字符串映射函数 our %actions = ...
- easyui按钮linkbutton 不可用(置灰)与 可用(取消置灰)
easyui linkbutton按钮: 不可用(置灰) $('#butFree').linkbutton('disable'); 可用(取消置灰) $('#butFree').linkbutton( ...
- MYSQL内存评估
### MySQL Memory Calculator Procedure ### http://kedar.nitty-witty.com/blog/calculte-mysql-memory-us ...
- 分布式配置 tachyon 并执行Hadoop样例 MapReduce
----------此文章.笔者按着tachyon官网教程进行安装并记录. (本地安装tachyon具体解释:http://blog.csdn.net/u012587561/article/detai ...
- T-SQL查询进阶--理解SQL Server中索引的概念,原理以及其他
简介 在SQL Server中,索引是一种增强式的存在,这意味着,即使没有索引,SQL Server仍然可以实现应有的功能.但索引可以在大多数情况下大大提升查询性能,在OLAP中尤其明显.要完全理解索 ...
- C# 创建windows 服务
1. 新建项目 1.1 右键解决方案 – 添加 – 新建项目 1.2 已安装模板 - windows - windows服务 – 输入名称 – 点击 ”确定” 2. 添加相应的 ...
- Android RoboGuice开源框架、Butter Knife开源框架浅析
Google Guice on Android(RoboGuice) 今天介绍一下Google的这个开源框架RoboGuice, 它的作用跟之前讲过的Dagger框架差点儿是一样的,仅仅是Dagger ...