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

Notes on installing php Redis extension under Fedora

高洛峰
Release: 2023-03-03 20:14:01
Original
987 people have browsed it

1. Install the compilation tool

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

2. Install redis php-redis

# yum install redis php-redis
Copy after login

The installation is successful

Start redis

# sudo redis-server /etc/redis.conf
Copy after login

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
Copy after login

4. Compile and install

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

5. Add the installed redis .so module

# vim /etc/php.ini
Copy after login

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');
Copy after login

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


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