How we can use composer 1 & composer 2 both in the same machine. As a developer we worked on the multiple project in the same machine and situation comes where project 1 required composer 1 and project 2 required compower version 2.
This is what I used to have composer 1 & 2 both in the same machine. I am hoping this will helpful for someone, who want to use composer 1 & 2 both as separate command
Keep Composer 1 & 2 as separate command
Setup Composer 1:
Copy the current composer directory to new
cp `which composer` /usr/local/bin/composer1
Update it to version 1:
composer1 self-update --1
Upgrade to Composer 2 & create alias:
Update composer to version 2
composer self-update --2
Create symlink for composer2 (optional)
ln -s `which composer` /usr/local/bin/composer2
Now you can use composer
or composer2
command for the project dependent on composer 2 and composer1
command for the project have dependency on composer 1.
Note: you might required to use sudo before the command
for windows do the following steps:
one -> (create
composer1
directory in C:\composer_path)two -> (copy three file in
composer
directory tocomposer1
directory)three -> (set path
composer1
toenvironment variable
)four -> (run
composer1 self-update --1
in cmd) because Convert to version 1.0.0five -> (test versions composer)
and Done! ^_^
you can see two version of composer installed in one windows system.
reference : How to install two composer in one windows system?
© 2022 - 2024 — McMap. All rights reserved.
How to keep composer 1 & 2 both in same machine?
and then add your answer and accept it. – Ludwigshafen