Linux下php添加memcache扩展

很多时候我们都会遇到在已经安装的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();
?>

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

原文地址:https://www.cnblogs.com/573734817pc/p/10127427.html

时间: 2024-08-06 00:03:39

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

Linux下php安装memcache扩展

安装环境:CentOS 6.4 php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法. 1.下载 下载地址:http://pecl.php.net/package/memcache 文件名:memcache-3.0.8.tgz 文件下载成功后上传至/usr/local目录 2.安装 [[email protected] local]# tar -zxvf memcache-3.0.8.tgz[email protected] local]# cd memc

Linux下PHP添加openssl扩展

安装PHP成功后,进入 PHP 的源码包 #cd /usr/local/src/php-5.6.8 进入openssl扩展模块的目录 #cd ext/openssl 在当前目录下执行 # mv config0.m4   config.m4 #/usr/local/php/bin/phpize //这里为你自己的phpize路径,如果找不到,可以用whereis phpize查找 #./configure --help |grep openssl 查看安装openssl扩展需要的相关选项 #./c

Linux下PHP安装oci8扩展

PHP通常搭配Mysql使用,但有时候也会连接到Oracle数据库.安装PHP的oci8扩张之前,需要先安装Oracle Instant Client( basic 或 basic lite 版就行了).因为我们是从源码安装PHP扩展,所以还需要下载 Instant Client SDK.Oracle Instant Client相关软件包的下载请进入以下链接:http://www.oracle.com/technetwork/database/features/instant-client/i

Linux下php安装memcache

Linux下php安装memcache说明:php安装目录:/phpstudy/server/php/bin/phpphp.ini配置文件路径:/phpstudy/server/php/etc/php.ini 1.安装编译工具yum install wget make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils patch perl2.安装memcachecd /usr/local/src #进入

Linux下安装Redis及Linux下php安装Redis扩展

下载源码:wget http://redis.googlecode.com/files/redis-2.8.19.tar.gz 1.解压安装:  wget http://download.redis.io/releases/redis-2.8.19.tar.gz   tar xzf redis-2.8.19.tar.gz   cd redis-2.8.19  make   make install  cp redis.conf /etc/ 参数介绍: make install命令执行完成后,会在

linux下Redis与phpredis扩展安装

++++++++++++++++++++++++++++++++++++++++++++++linux下Redis与phpredis扩展安装++++++++++++++++++++++++++++++++++++++++++++++操作系统   : [CentOS6.0]redis  : [redis-2.4.3]phpredis   : [phpredis-2.1.0]++++++++++++++++++++++++++++++++++++++++++++++准备安装软件(download) 

linux下PHP安装openssl扩展

很多时候都会用到openssl组件,下面就介绍一下linux下php安装openssl扩展: 安装openssl组件,一般php安装目录中都有许多扩展组件的安装包,当然也包括openssl,例如我的php安装目录是/data/php-5.4.32,那么openssl组件的安装目录则为/data/php-5.4.32/ext/openssl,然后执行以下操作 (1) cd /data/php-5.4.32/ext/openssl (2) mv config0.m4 config.m4 (3) /d

Linux下动态安装PHP扩展的一般方法(图)

------------------------------------------------------------------------------------------------------ 首先解释下面的Linux命令: ./configure  #脚本配置工具 ./configure --help  #查看脚本配置工具configure的命令行选项 /usr/local/php/bin/phpize #phpsize命令用于在编译好的PHP中扩展模块 [email protec

Linux下ffmpeg添加?x265

Linux下ffmpeg添加?x265 在linux 上安装ffmpeg 支持h265编码器按照以下步骤: 1.安装 Mercurial : 2.安装CMake 2.8.8 or later: 3.YASM 1.2.0 及以上版本: 4.Download the libx265 repository and build as per the instructions here: https://bitbucket.org/multicoreware/x265/wiki/Home (note I