-1

I'm working remotely on a Laravel project that runs on LAMP/WAMP/XAMPP (without vm or containers.) My local environment currently has he most up-to-date version of php. There are 3 other developers, and each may have a different version of WAMP, LAMP and XAMPP. I added a new vender software package to my vender folder via Composer, and updated all of the vender packages to the most current versions that my machine can run. I pushed these changes in a feature branch to our repo, and pulled it to a test server and ran

 composer.phar install --no-dev

The server returned lots of problems, related to the fact the the test server was running an older version of php. I am not allowed to update this server. It's not going to be updated any time soon. This server may not represent the oldest environment used by the client. I need to find the server with the oldest setup and update the composer files to software versions that will run on it. How do I downgrade the composer setup, then facilitate a downgrade across all of the team's setups? Currently, I have several vender packages (including the new one that only I have) in my local environment that are too new to run in some of our team's other server environments. Unifying all server environments is not currently an option.

Hoytman
  • 1,722
  • 2
  • 17
  • 29
  • Can you share more details? Why not run all servers, especially the test server, on the exact same versions than your live server? Also, why not use this same version on all developer machines? There will always be problems related to such differences, so you absolutely need to remove this problem – Nico Haase Nov 17 '20 at 06:38
  • If that is not possible: why not adjust your version constraints in `composer.json` such that all packages are compatible with the live server? – Nico Haase Nov 17 '20 at 06:39
  • I am trying to get access to the servers so that I can update the versions, however, this is a long and difficult process. It looks like I need to run `composer update` on the server with the oldest software versions, make a copy of the resulting composer.lock file and add that to the master development branch in the git repo, pull the update to all the repos and run `composer install` to downgrade everything. – Hoytman Nov 18 '20 at 21:52
  • No, please don't run `composer update` on any other server. What about using https://stackoverflow.com/questions/35273522/how-to-always-use-ignore-platform-reqs-flag-when-running-composer? – Nico Haase Nov 19 '20 at 07:47

1 Answers1

-1

The easiest solution for this is use multiple php version like php 7.4 , php 7.3 and older , i am laravel developer and running Laragon for laravel which help me to add multiple versions in my local machine.

  • Please post answers to the question: How do I downgrade the composer setup, then facilitate a downgrade across all of the team's setups? – Hoytman Nov 16 '20 at 16:33
  • this is the answer of your question because composer always pick dependencies from composer.lock.json file and you will face the same issue thats why i ask you to use multiple php version – tameemahmad shahzad Nov 16 '20 at 16:36
  • We are already using multiple php versions. That is causing the problem. Your basically saying that my problem is the solution. – Hoytman Nov 16 '20 at 16:46
  • then add composer.lock file into gitignore so when you checkout branches then you have your original lock file through this you get all the dependencies according to your php version – tameemahmad shahzad Nov 16 '20 at 16:49