0

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

Edward
  • 1
  • 3
  • Why should they provide it for such a massively outdated PHP version, that has not even received any security fixes for ages? https://www.php.net/supported-versions.php – CBroe Jul 13 '21 at 11:51
  • @CBroe is it not possible then? We're working on a codebase where things haven't been updated in a long time, trying to incrementally upgrade things to avoid breaking all things and php5.6 is hardcoded into quite a few places so if we could get it working on ubuntu 16 with 5.6 before upgrading php then I can die happy – Edward Jul 13 '21 at 13:36

2 Answers2

0

if you dont install the Redis itself on your ubuntu then you need to install it first by this command:

sudo apt-get install redis-server

after enabling it:

sudo systemctl enable redis-server.service

install the php extenstion:

sudo apt-get install php5.6-redis
AliHpanahi
  • 139
  • 7
  • Hey AliHpanahi, Thanks for taking the time to write a solution, I'm afraid this didn't work. we get the same error of: ``` 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' ``` it feels almost like there's no version of php-redis for php5.6 on ubuntu 16, but that can't be the case can it? – Edward Jul 13 '21 at 13:34
0

If you installed Redis you can continue with this:

First you need to add repository:

sudo apt-add-repository -y ppa:ondrej/php

Then update APT:

sudo apt-get update

Finally, install php-redis from apt:

sudo apt-get install php-redis
Poyraz HANCILAR
  • 409
  • 1
  • 4
  • 12