Home > php教程 > php手册 > Fedora下安装php Redis扩展笔记,fedoraredis

Fedora下安装php Redis扩展笔记,fedoraredis

WBOY
Release: 2016-06-13 09:25:50
Original
1103 people have browsed it

Fedora下安装php Redis扩展笔记,fedoraredis

一、安装编译工具

复制代码 代码如下:


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


二、安装redis php-redis

复制代码 代码如下:


# yum install redis php-redis

这样就安装成功了

启动redis

复制代码 代码如下:


# sudo redis-server /etc/redis.conf

1、下载php-redis zip安装包

https://github.com/nicolasff/phpredis

2、找到PHP安装路径

命令whereis phpize和whereis php-config 找到phpize和php-config路径

3、生成configure

复制代码 代码如下:

# /usr/bin/phpize

4、编译安装

复制代码 代码如下:


# ./configure --with-php-config=/usr/bin/php-config
# make && make install

5、加入安装的redis.so模块

复制代码 代码如下:


# vim /etc/php.ini


6、重启apache或nginx

7、测试

复制代码 代码如下:


$redis = new Redis();
$redis->connect('127.0.0.1',6379);
$redis->set('test','hello world!');
echo $redis->get('test');

php添加redis 扩展

去看下错误日志~
 

php 安装redis扩展错误

你的php是VC6编译的

你的php_redis.dll是VC9编译的
导致不兼容。
找个VC6的php_redis.dll

重装个VC9的php
都可以。
 

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template