--This is a record of your struggles when installing Php Redis.
--Use AWS EC2 server - Amazon Linux2 --PHP version → 7.4.6 --Redis version → 6.3.0 --PHP and Redis are already installed.
--Please match the part of php74 with yours
yum list | grep php74 | grep redis
Execution result
It looks like it's kind of nice. But I want to install Php Redis. I'm curious that the name is a little different. Check the contents once.
yum info php74-php-pecl-redis5.x86_64
Execution result
Let's jump to Link shown in result.
Let's jump to Homepage.
I'm going to Php Redis' GitHub. That is, php74-php-pecl-redis5.x86_64 in the yum repository is the same as PhpRedis.
Now let's install Php Redis. There is also a way to build the source, but it is now possible to install the package. There is no way not to use it w
yum insatall php74-php-pecl-redis5.x86_64
Execution result
This is an error. It seems that the package: ** liblzf ** is missing to contain php74-php-pecl-redis5.x86_64.
liblzf Take a look at liblzf's Home Page (http://software.schmorp.de/pkg/liblzf.html). liblzf seems to be a library for data compression. Searching for the installation method of liblzf does not hit easily. I couldn't find anything like that in the yum list. Therefore, I referred to the following image part of the site of here.
The image shows how to use rmp instead of yum. And it seems that having epel installed is a prerequisite for installing liblzf. I already have epel in my environment. If you need it, install epel. The explanation of epel is omitted here.
Install liblzf.
yum install liblzf --enablerepo=epel
Execution result
After the liblzf installation is complete, install PhpRedis again.
yum insatall php74-php-pecl-redis5.x86_64 --enablerepo=remi
Execution result It looks good.
yum list installed | grep liblzf
yum list installed | grep redis
Execution result
--Php Redis can be installed as a package. --However, there are various package dependency problems, so it is necessary to install the missing package in each environment each time. In my case it was liblzf. --Installing liblzf ――The pitfall this time was that it was in epel, not in the yum repository.
Recommended Posts