很多时候我们都会遇到在已经安装的php中添加其它的扩展。

那我们应该怎么做呢?

这样做。(我们的nginx和php都是已经安装好了的,这里就不做赘述了)

首先,我们需要下载php的memcache扩展包。

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/fastphp/bin/phpize  #用phpize生成configure配置文件
./configure  --with-php-config=/usr/local/fastphp/bin/php-config  #配置

make  #编译
make install #安装

安装完成之后,出现下面的界面,记住以下路径,后面会用到。
/usr/local/fastphp/lib/php/extensions/no-debug-non-zts-20131226/  #memcache模块路径

3、配置php支持memcache
vi /usr/local/fastphp/etc/php.ini  #编辑配置文件,在最后一行添加以下内容

extension=/usr/local/fastphp/lib/php/extensions/no-debug-non-zts-20131226/memcache.so

4、测试
vi /usr/local/nginx/html/test.php   #编辑
<?php
phpinfo();
?>

访问页面,如果出现以下效果则证明成功。

Linux下php添加memcache扩展的更多相关文章

  1. Linux下php安装memcache扩展

    安装环境:CentOS 6.4 php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法. 1.下载 下载地址:http://pecl.php.net/packag ...

  2. linux下Redis与phpredis扩展安装

    ++++++++++++++++++++++++++++++++++++++++++++++linux下Redis与phpredis扩展安装++++++++++++++++++++++++++++++ ...

  3. Linux下php安装memcache

    Linux下php安装memcache说明:php安装目录:/phpstudy/server/php/bin/phpphp.ini配置文件路径:/phpstudy/server/php/etc/php ...

  4. linux下永久添加静态路由

    在linux下永久添加静态路由有两种方法: 添加路由的命令: 1,route add route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0 ...

  5. linux上安装php7 memcache扩展 和 安装服务端memcached

    linux上安装memcached不算太困难.唯一让本人感到困难的是 php7的memcache扩展安装.真的蛋疼! 先说安装服务端 memcached 1. 首先安装Libevent事件触发管理器. ...

  6. linux安装memcached及memcache扩展

    一.安装libevent函数库 下载地址:http://libevent.org 默认被安装到:/usr/local/lib目录下 安装memcached之前需要先安装libevent函数库. 可以通 ...

  7. linux 下安装 php kafka 扩展

    我们使用官方推荐 php kafka 扩展 phpkafka,由于该扩展是基于 librdkafka 开发,所以我们首先需要安装 librdkafka 下载地址:http://kafka.apache ...

  8. windows安装memcache并为php添加memcache扩展

    第一步:安装包下载 1.4.5 版本之前用作为一个服务安装,1.4.5 版本之后用任务计划中启用一个普通进程来使用 具体内容如以下链接:http://www.runoob.com/memcached/ ...

  9. Linux下php安装Redis扩展

    说明: 操作系统:CentOS php安装目录:/usr/local/php php.ini配置文件路径:/usr/local/php7/etc/php.ini Nginx安装目录:/usr/loca ...

随机推荐

  1. javaScript刷新页面

    刷新页面有一下几种: 1.直接在页面上: 每两秒刷新页面 <meta http-equiv="refresh" content="2"> 2.每秒刷 ...

  2. Spark partitionBy

    partitionBy 重新分区, repartition默认采用HashPartitioner分区,自己设计合理的分区方法(比如数量比较大的key 加个随机数 随机分到更多的分区, 这样处理数据倾斜 ...

  3. TensorFlow读取CSV数据

    代码来源于官方文档,做了一些小小的调整: # -*- coding:utf-8 -*- import tensorflow as tf filename_queue = tf.train.string ...

  4. yield和send函数

    yield作用类似于return,其本质是一个迭代器. 当程序执行到yield时,会结束本次循环,返回一个值,然后内置含有next()函数, 下次在执行时,会从yield结束的地方继续执行. 带yie ...

  5. nginx: [error] invalid PID number "" in "/usr/local/webserver/nginx/logs/nginx.pid" (原)

    进入nginx文件下,例如 :/usr/local/nginx/sbin [root@iZ25f7emo7cZ /]# cd /usr/local/nginx/sbin 运行命令: [root@iZ2 ...

  6. MyBatis基础入门《十七》动态SQL

    MyBatis基础入门<十七>动态SQL 描述: >> 完成多条件查询等逻辑实现 >> 用于实现动态SQL的元素主要有: > if > trim > ...

  7. c#除掉字符串最后一个字符几种方法

    有一数组:转换为字符串后为 aaa|bbb|ccc|ddd| 现要去掉最后一个| 第一种方法: 语句为:str1=aaa|bbb|ccc|ddd| str=str1.substring(0,lasti ...

  8. jQuery-使用hover(fn,fn)函数监听mouseover和mouseout两个事件

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  9. 合并dict、list的方法

    dict1={1:[1,11,111],2:[2,22,222]}dict2={3:[3,33,333],4:[4,44,444]}合并两个字典得到类似 {1:[1,11,111],2:[2,22,2 ...

  10. Lua用一维数组存储一个n阶方阵,输出这个方阵的正对角线上的数的和与反对角线上的数的和的差的绝对值。

    arr = {, , , , , , , , -} function diagonalDifference(arr) dimesion = math.sqrt(#arr) arr1 = {} sum1 ...