Home > Backend Development > PHP Tutorial > 装配Redis PHP扩展

装配Redis PHP扩展

WBOY
Release: 2016-06-13 11:56:11
Original
796 people have browsed it

安装Redis PHP扩展

说明:
? ? ? ?操作系统:CentOS

php安装目录:/usr/local/php

php.ini配置文件路径:/usr/local/php/etc/php.ini

Nginx安装目录:/usr/local/nginx

Nginx网站根目录:/usr/local/nginx/html

?

1、安装编译工具

yum install wget? make gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel kernel keyutils? patch perl

2、安装redis

下载:https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

上传phpredis-2.2.4.tar.gz到/usr/local/src目录

cd /usr/local/src?#进入软件包存放目录

tar zxvf phpredis-2.2.4.tar.gz?#解压

cd phpredis-2.2.4?#进入安装目录

/usr/local/php/bin/phpize?#用phpize生成configure配置文件

./configure --with-php-config=/usr/local/php/bin/php-config??#配置

make??#编译

make install??#安装

安装完成之后,出现下面的安装路径

/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/

3、配置php支持

vi /usr/local/php/etc/php.ini??#编辑配置文件,在最后一行添加以下内容

添加

extension="redis.so"

?

:wq!?#保存退出

重启php-fpm

转自?http://www.osyunwei.com/archives/7210.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template