DEV Community

David Loor
David Loor

Posted on • Edited on • Originally published at davidloor.com

1

How to co-install composer 1 and composer 2

If you followed the steps at How to set-up a Drupal or WordPress site locally using Docker to set-up a local Drupal 8 site using docker, you will find that the PHP container has composer2 and that Drupal 8 is not compatible with it.

The easiest way to get composer 1 up and running when one already has composer 2 installed is by running this command: composer self-update --1 It will replace composer 2 completely though.

If for some reason you need to have both composer 1 and composer 2 co-installed you can run these simple commands in the terminal (Assuming you have composer 2 already working):

sudo cp `which composer` /usr/local/bin/composer1 && sudo composer1 self-update --1

sudo composer self-update --2 && sudo ln -s `which composer` /usr/local/bin/composer2

Enter fullscreen mode Exit fullscreen mode

After running the commands above you should be able to run composer1 or composer2 instead of just composer, based on one's needs.

Example to use composer 1:

composer1 install
Enter fullscreen mode Exit fullscreen mode

Example to use composer 2:

composer2 install
Enter fullscreen mode Exit fullscreen mode

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs