Home  >  Article  >  Backend Development  >  Notes on installing php Redis extension under Fedora

Notes on installing php Redis extension under Fedora

高洛峰
高洛峰Original
2016-12-21 15:04:56935browse

1. Install the compilation tool

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

2. Install redis php-redis

# yum install redis php-redis

The installation is successful

Start redis

# sudo redis-server /etc/redis.conf

1. Download the php-redis zip installation package

https://github.com/ nicolasff/phpredis

2. Find the PHP installation path

Command whereis phpize and whereis php-config Find the phpize and php-config paths

3. Generate configure

# /usr/bin/phpize

4. Compile and install

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

5. Add the installed redis .so module

# vim /etc/php.ini

6. Restart apache or nginx

7. Test

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

For more related articles about installing php Redis extension notes under Fedora, please pay attention to the PHP Chinese website!


Statement:
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