Website Composer is so hard to manage [STRUGGLING A LOT ]
Hello Guys, I have a Laravel project deployed on Digital Ocean LAMP ubuntu 22.04. I am so new and I struggle a lot with dealing with " different versions, updates, dependences & almost everything related to composer "
my project is using Laravel version 8.83.11 | PHP 7.3.1 [ On Local machine ]
On Production I had the same PHP version when I installed it. but then I did run composer update by mistake and the PHP version now 8.1
I can not do any new changes .. I can not use composer and I tried multiple times to remove the packages that is causing the composer error. but failed. Can someone please help, what is the best approach to handle composer on production and avoid these compatibility issues . How can I solve the situation now ? I was thinking to remove PHP and downgrade the version on production. but am afraid to screw things up.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/dbal 3.3.8 -> satisfiable by doctrine/dbal[3.3.8].
- doctrine/dbal 3.3.8 requires composer-runtime-api ^2 -> no matching package found.
Problem 2
- cyrildewit/eloquent-viewable v5.2.1 requires php ^7.2 -> your PHP version (8.1.12) does not satisfy that requirement.
- cyrildewit/eloquent-viewable v5.2.1 requires php ^7.2 -> your PHP version (8.1.12) does not satisfy that requirement.
- Installation request for cyrildewit/eloquent-viewable v5.2.1 -> satisfi
@mahmoudmonem You should be using the same versions of PHP in both production and in your local environment.
There’s no point developing using different versions in different environments, otherwise you’re going to continually hit issues like this.
So, standardise what version of PHP you’re working on use that throughout your environments. You should always be using the latest version. There’s no reason not to run Laravel 8 on PHP 8.x
As Martin said, updating your local machine to PHP 8.1 to match your production environment is the best way forward. Especially since PHP7.x versions no longer receive any security updates anymore.