很多时候我们都会遇到在已经安装的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. [LeetCode] 111. Minimum Depth of Binary Tree_Easy tag:DFS

    Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shor ...

  2. CentOS6.5安装Elasticsearch5.3.0

    1. 首页到官方网站下载最新安装包 https://www.elastic.co/downloads/elasticsearch elasticsearch-5.3.0.tar.gz 2. 将软件包上 ...

  3. .NET拾忆:FormData文件上传

    方法1.FormData简单实现 后端: using System; using System.Collections.Generic; using System.IO; using System.L ...

  4. 基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0

    基于python+Testlink+Jenkins实现的接口自动化测试框架V3.0 目录 1. 开发环境2. 主要功能逻辑介绍3. 框架功能简介 4. 数据库的创建 5. 框架模块详细介绍6. Tes ...

  5. JavaScript-年月日转换12小时制

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

  6. Ajax技术之使用XMLHttpRequest对象(一)【初始化XMLHttpRequest对象】

    在初始化XMLHttpRequest对象时要考虑两种情况,一种是IE浏览器,另一种是非IE浏览器.在IE浏览器中要把XMLHttpRequest实例化一个ActiveX对象 http_request ...

  7. Oracle TNS-01190: The user is not authorized to execute the requested listener command

    今天,在玩 lsnrctl命令,是为了了解Oracle的一些配置. 当执行 show inbound_connect_timeout 命令之后,提示了错误信息: TNS-01190: The user ...

  8. Python记录5:函数1

    函数 ''' 1. 什么是函数     在程序中具备某一功能的工具->函数     函数的使用必须遵循原则:         先定义         后调用 函数分为两大类:         1 ...

  9. Hello py

    https://www.cnblogs.com/AdaminXie/p/8339863.html https://www.cnblogs.com/-clq/p/8340515.html https:/ ...

  10. SQLSetEnvAttr

    SQLSetEnvAttr 函数定义: 函数的大概意思就是将,第一个参数设置为第二个参数的属性 SQLRETURN SQLSetEnvAttr( SQLHENV     EnvironmentHand ...