We are upgrading from ubuntu 14 to ubuntu 16, but are encountering problems installing php-redis. We’re trying to get php-redis for php 5.6 but php-redis for php8.0 is being installed instead. When specifying the version e.g.
sudo apt-get install php5.6-redis
we get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5.6-redis
E: Couldn't find any package by glob 'php5.6-redis'
E: Couldn't find any package by regex 'php5.6-redis'
we looked into https://launchpad.net/~ondrej/+archive/ubuntu/php/ but it seems this would only work for ubuntu 18+
any help is much appreciated on how we can install php-redis for php 5.6 on ubuntu 16
2
Answers
if you dont install the Redis itself on your ubuntu then you need to install it first by this command:
after enabling it:
install the php extenstion:
If you installed Redis you can continue with this:
First you need to add repository:
Then update APT:
Finally, install php-redis from apt: