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 :
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.
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.
I think your core issue is going to be because of this:
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:
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
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.