# Deploy on AWS EC2 Ubuntu 23 error - ext-redis is missing

**URL:** <https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405>\
**Category:** Uncategorized\
**Created:** [July 22, 2023, 3:34am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405 "2023-07-22T03:34:44Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 22, 2023, 3:34am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/1 "2023-07-22T03:34:44Z")

</div>

I’m deploying my web project (Laminas Framework with Composer) on Amazon AWS on EC2 instance running Ubuntu 23 with PHP8.1. Everything works fine before using Redis server for caching datas (sessions, translations files, etc.). On my local machine, everything works but when I deploy it on the EC2 instance, I get this error :

 ![Laminas deployment error](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/2X/8/8db7d08e89687b4b3f982d8f01b01598e894168f.png)

Is there any person who encoutered this type of problem ? Any suggestion to solve it please ?

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [July 22, 2023, 4:28pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/2 "2023-07-22T16:28:37Z")

</div>

When it says locked, delete composer.lock file and install again.

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 23, 2023, 9:02am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/3 "2023-07-23T09:02:55Z")

</div>

I tried but it does not work. I get the same error message

> Package laminas/laminas-cache-storage-adapter-redis has requirements incompatible with your PHP version, PHP extensions and Composer version:  
> - laminas/laminas-cache-storage-adapter-redis 2.5.0 requires ext-redis ^4.3 || ^5.0.2 which does not match your installed version 6.0.0-dev.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [July 23, 2023, 2:28pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/4 "2023-07-23T14:28:13Z")

</div>

Did you require or require --dev that package?

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 23, 2023, 4:22pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/5 "2023-07-23T16:22:25Z")

</div>

@Tyrsson , how can I require --dev that package ? When installing on local machine, I did not set this specification.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [July 23, 2023, 5:28pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/6 "2023-07-23T17:28:23Z")

</div>

> [@ebuddy](#):
>
> - laminas/laminas-cache-storage-adapter-redis 2.5.0 requires ext-redis ^4.3 || ^5.0.2 which does not match your installed version 6.0.0-dev

It is caused by this:  
[https://github.com/laminas/laminas-cache-storage-adapter-redis/blob/2.6.x/composer.json#L11](https://github.com/laminas/laminas-cache-storage-adapter-redis/blob/2.6.x/composer.json#L11)

Its not per-say the package versions that is causing the composer issue from what it looks like its the ext-redis version itself that is causing your issue.

Since there is an entry for the ext-redis version composer is going to verify that its correct. Just like it will for your php version. As I understand it.

Might want to take a look at:  
[https://getcomposer.org/doc/articles/versions.md](https://getcomposer.org/doc/articles/versions.md)

Since it uses ^5.0.2 but its finding 6.0.0-dev it will not accept it because its a major version change. ^ will allow a bump in minor, but not in major. If I understand it correctly.

So, the question becomes where and how is the ext-redis 6.0.0-dev version being used instead of a stable 5.\* version since the package can use that.

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 23, 2023, 7:35pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/7 "2023-07-23T19:35:26Z")

</div>

The last sentence says all. I’m looking for a solution since two weeks

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [July 24, 2023, 6:49am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/8 "2023-07-24T06:49:39Z")

</div>

Can you share your composer.json file content? I hope it doesn’t have any FBI secrets in it or any stock trade confidential information. If not please share it.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [July 24, 2023, 8:57pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/9 "2023-07-24T20:57:00Z")

</div>

Is there a way in the EC2 configuration to specify which version of ext-redis is used? I’m not sure why a -dev version would be used there. Seems real bleeding edge to me for a production environment…

@ALTAMASH80 The composer.json that is causing the issue is the one from the storage adapter I linked to in my previous post. His issue (I think) is because for whatever reason his EC2 instance is using a ext-redis v6.0.0-dev (which I have not figured out how is possible, unless its a custom thing for AWS, which they do from time to time). – Edit – Might have found it. See below for the AWS link.

@ebuddy  
I think your core issue is going to be because of this:

> **[Supported ElastiCache for Redis versions - Amazon ElastiCache for Redis](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html)**
>
> Supported ElastiCache for Redis versions ElastiCache for Redis 7.0 adds a number of improvements and support for new functionality: Redis Functions : ElastiCache for Redis 7 adds support for Redis Functions, and provides a managed experience enabling...

Maybe. But there is most likely what is supplying your 6.0.0 version.

Also, its not that ext-redis is missing. The issue is that composer is finding the wrong version.

You might want to try deploying it with this version specified:

> **[Supported ElastiCache for Redis versions - Amazon ElastiCache for Redis](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html#redis-version-5-0.6)**
>
> Supported ElastiCache for Redis versions ElastiCache for Redis 7.0 adds a number of improvements and support for new functionality: Redis Functions : ElastiCache for Redis 7 adds support for Redis Functions, and provides a managed experience enabling...

SInce your composer constraint will allow patches and minor bumps. That “should” work. Then the next question is if the laminas adapter will play nice. Honestly, I do not know enough about it to even guess if it will work even if the install proceeds. But it might very well fix your composer issue. Which is the only thing I am addressing.

If that is not possible. You could also see this link and it explains how to ignore that constraint

> **[How to install Composer packages ignoring PHP version requirements](https://php.watch/articles/composer-ignore-platform-req)**
>
> How to force-install PHP packages, ignoring version requirements set by dependencies

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 26, 2023, 8:15pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/10 "2023-07-26T20:15:16Z")

</div>

Here is my composer.json file content

```auto
{
    "name": "laminas/laminas-mvc-skeleton",
    "description": "Laminas MVC Skeleton Application",
    "type": "project",
    "license": "BSD-3-Clause",
    "keywords": [
        "laminas",
        "mvc",
        "skeleton",
        "framework"
    ],
    "require": {
        "laminas/laminas-component-installer": "^3.2",
        "laminas/laminas-skeleton-installer": "^1.2",
        "laminas/laminas-mvc": "^3.6",
        "laminas/laminas-db": "^2.18",
        "laminas/laminas-mvc-form": "^2.1",
        "laminas/laminas-mvc-i18n": "^1.7",
        "laminas/laminas-mvc-plugins": "^1.2",
        "laminas/laminas-session": "^2.16",
        "laminas/laminas-crypt": "^3.10",
        "phpmailer/phpmailer": "^6.8",
        "aws/aws-sdk-php": "^3.269",
        "laminas/laminas-cli": "^1.8",
        "setasign/fpdf": "^1.8",
        "laminas/laminas-serializer": "^2.14",
        "laminas/laminas-navigation": "^2.18",
        "laminas/laminas-permissions-acl": "^2.14",
        "ifsnop/mysqldump-php": "^2.12",
        "laminas/laminas-recaptcha": "^3.6",
        "laminas/laminas-captcha": "^2.16",
        "phpseclib/phpseclib": "^3.0",
        "jbroadway/urlify": "^1.2",
        "laminas/laminas-log": "^2.16",
        "laminas/laminas-cache-storage-adapter-filesystem": "^2.0",
        "laminas/laminas-cache": "3.10",
        "laminas/laminas-cache-storage-deprecated-factory": "^1.1",
        "laminas/laminas-cache-storage-adapter-redis": "^2.5"
    },
    "autoload": {
        "psr-4": {
            "Application\\": "module/Application/src/",
            "Commun\\": "module/Commun/src/",
            "Admin\\": "module/Admin/src/",
            "Services\\": "module/Services/src/"
        }
    },
    "config": {
        "allow-plugins": {
            "laminas/laminas-component-installer": true,
            "laminas/laminas-skeleton-installer": true
        }
    },
    "require-dev": {
        "laminas/laminas-developer-tools": "^2.8"
    }
}

```

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [July 27, 2023, 6:45am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/11 "2023-07-27T06:45:40Z")

</div>

Hi @ebuddy,

Check your Redis version. If it outputs v6.0.0-dev. It means you need to downgrade your Redis version. To check the Redis version you can see this [link.](https://www.w3schools.io/nosql/redis-check-version/)

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 27, 2023, 9:02am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/12 "2023-07-27T09:02:34Z")

</div>

![redis-version](https://canada1.discourse-cdn.com/flex032/uploads/zendframework/original/2X/f/f11840873c2508409d80b3757621a156a25b4291.png)

Here is my redis version

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [July 27, 2023, 9:29am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/13 "2023-07-27T09:29:52Z")

</div>

@ebuddy ,  
Damn! You’re using the windows cancer operating system for PHP development. I don’t know why I assumed you’re using some Linux version. For Windows, I’ve no clue how to resolve your issue. But what I can say is that you may need to downgrade your Redis cache version or install version 5 of Redis on your system. For that, you may need to uninstall the current Redis version 3.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [July 29, 2023, 5:24am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/14 "2023-07-29T05:24:35Z")

</div>

@ALTAMASH80  
Keep in mind, that the issue referenced is only happening when he deploys to AWS. That was the issue. Not what is installed on his local. It works there as he previously stated.

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [July 29, 2023, 8:14am UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/15 "2023-07-29T08:14:54Z")

</div>

Thanks for the information that the EC2 instance can be deployed on a local machine. When I’ll use it I’ll keep this thread in mind.

---

<div class="post-metadata">

**Author:** ![Tyrsson](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tyrsson/32/1664_2.png) [@Tyrsson](https://discourse.laminas.dev/u/Tyrsson)\
**Post date:** [July 29, 2023, 4:56pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/16 "2023-07-29T16:56:55Z")

</div>

@ALTAMASH80

In his first post. The screenshot is from where he is connected to that instance. The composer errors are being reported from the remote AWS instance.

---

<div class="post-metadata">

**Author:** ![ebuddy](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/ebuddy/32/1536_2.png) [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Post date:** [July 29, 2023, 5:00pm UTC](https://discourse.laminas.dev/t/deploy-on-aws-ec2-ubuntu-23-error-ext-redis-is-missing/3405/17 "2023-07-29T17:00:11Z")

</div>

Thank you bro. You clearly understood my problem.
