> For the complete documentation index, see [llms.txt](https://learnimportant.gitbook.io/learn-important/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnimportant.gitbook.io/learn-important/windows10/how-to-install-two-composer-in-one-windows-system-ok.md).

# How to install two composer in one windows system (ok)

https\://stackoverflow\.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#64598028

### Solution 1

```
https://github.com/composer/composer/tags
https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#64598028
```

<figure><img src="https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2FVbSPQi7kkB9UzTKNeO3L%2Fimage.png?alt=media&amp;token=e8c2b347-a948-4e87-81b2-b7862fde1354" alt=""><figcaption><p>composer self-update 2.7.9</p></figcaption></figure>

```
composer self-update 2.7.9
```

## [How to downgrade or install a specific version of Composer?](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer)

[Ask Question](https://stackoverflow.com/questions/ask)Asked 4 years, 3 months agoModified [1 year, 4 months ago](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028?lastactivity)Viewed 281k times Part of [PHP](https://stackoverflow.com/collectives/php) Collective143

I'm getting the following error in a project I'm setting up:

> You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

I've started at a new company this week, just trying to get their projects installed and there doesn't seem to be a way to change my composer version on Windows. I'd rather not update all their packages as I'm not familiar with the projects yet and have no clue what kind of implications go into that.

* [php](https://stackoverflow.com/questions/tagged/php)
* [windows](https://stackoverflow.com/questions/tagged/windows)
* [composer-php](https://stackoverflow.com/questions/tagged/composer-php)

[Share](https://stackoverflow.com/q/64597051)[Improve this question](https://stackoverflow.com/posts/64597051/edit)Follow[edited Jan 19, 2021 at 9:08](https://stackoverflow.com/posts/64597051/revisions)[![yivi's user avatar](https://i.sstatic.net/rHdZU.png?s=64)](https://stackoverflow.com/users/1426539/yivi)[yivi](https://stackoverflow.com/users/1426539/yivi)47.4k1818 gold badges130130 silver badges153153 bronze badgesasked Oct 29, 2020 at 18:21[![Bash's user avatar](https://www.gravatar.com/avatar/2bfd0829d43459ede5f6c31c2ea3fe5a?s=64\&d=identicon\&r=PG\&f=y\&so-version=2)](https://stackoverflow.com/users/6581796/bash)[Bash](https://stackoverflow.com/users/6581796/bash)1,61822 gold badges1212 silver badges1414 bronze badges

* `composer --version` to check the current version – [tinystone](https://stackoverflow.com/users/18697532/tinystone) [CommentedApr 12, 2023 at 1:12](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment134027057_64597051)

[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)

### 7 Answers

Sorted by:                                              Highest score (default)                                                                   Trending (recent votes count more)                                                                   Date modified (newest first)                                                                   Date created (oldest first)                              390

Assuming a regular composer installation, to rollback to version 1 of composer, you simply execute:

```
composer self-update --1
```

When you want to go back to version 2 (which you should, after updating or removing the incompatible plugins):

```
composer self-update --2
```

***

The above will take you to the latest on any of the two major versions.

You can also "update" to a specific version just by passing the version number to `self-update`:

```
composer self-update 1.10.12
composer self-update 2.0.7
```

After performing any `self-update`, you can specify `--rollback` to go back to the previously installed version.

```
composer self-update
composer self-update --rollback
```

Finally, if you are feeling adventurous, you can update to a pre-release version by executing:

```
composer self-update --preview
```

[Share](https://stackoverflow.com/a/64598028)[Improve this answer](https://stackoverflow.com/posts/64598028/edit)Follow[edited Oct 18, 2021 at 13:42](https://stackoverflow.com/posts/64598028/revisions)answered Oct 29, 2020 at 19:33[![yivi's user avatar](https://i.sstatic.net/rHdZU.png?s=64)](https://stackoverflow.com/users/1426539/yivi)[yivi](https://stackoverflow.com/users/1426539/yivi)47.4k1818 gold badges130130 silver badges153153 bronze badges

* 4Just want to add, if get permission error like me, then add "sudo" to run the cmd. – [zhihong](https://stackoverflow.com/users/877513/zhihong) [CommentedNov 16, 2020 at 16:03 ](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment114675294_64598028)
* Additional info: If you're inside of a version, you can change by using de specific version number. Let's say you're in composer `1.10.17` whats currently latest and want to have e.g. `1.10.1` you can use `composer self-update 1.10.1` this would change it. But changing major version is as described above. – [Dwza](https://stackoverflow.com/users/1906168/dwza) [CommentedNov 18, 2020 at 18:19 ](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment114741470_64598028)
* Note that `self-update` is inconsistently intelligent, in that if you specify 2.2, it'll find the latest sub-version but fail to install it, saying "You forced the install of 2.2.18 via --2.2" and "Version "2.2" could not be found" :facepalm:... so, while some might argue it may not be safe for it to install the sub-version it found, I've generally found it OK to do that with other apps when they do it automatically. Also, its other compatibility warnings tend to be on the x.y level, not on the x.y.z level, so I find the inconsistency annoying and a bit cognitively dissonant. – [SteveExdia](https://stackoverflow.com/users/14744970/steveexdia) [CommentedSep 27, 2022 at 16:34 ](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment130437244_64598028)
* `composer self-update --1` or `composer self-update --2` – [vintagexav](https://stackoverflow.com/users/4135524/vintagexav) [CommentedJul 13, 2023 at 14:09 ](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment135190356_64598028)
* Hi @yivi I am getting error when i try to downgrade composer from 2 to 1. the error are, \[Composer\Downloader\TransportException] curl error 28 while downloading [getcomposer.org/versions](https://getcomposer.org/versions): Connection timed out after 10018 milliseconds – [zus](https://stackoverflow.com/users/11697039/zus) [CommentedDec 10, 2024 at 11:04 ](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#comment139779582_64598028)

[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)Report this ad9

If you have already installed composer on your system. then paste the below code to downgrade the composer version with a specific version as per your need.

```php
composer self-update 1.10.14
```

for ubuntu system use the below command

```php
sudo -H composer self-update 1.10.14
```

[Share](https://stackoverflow.com/a/65088252)[Improve this answer](https://stackoverflow.com/posts/65088252/edit)Follow[edited Oct 13, 2021 at 13:12](https://stackoverflow.com/posts/65088252/revisions)[![yivi's user avatar](https://i.sstatic.net/rHdZU.png?s=64)](https://stackoverflow.com/users/1426539/yivi)[yivi](https://stackoverflow.com/users/1426539/yivi)47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 1, 2020 at 9:54[![Pratik Bharodiya's user avatar](https://i.sstatic.net/d1sZK.jpg?s=64)](https://stackoverflow.com/users/11620565/pratik-bharodiya)[Pratik Bharodiya](https://stackoverflow.com/users/11620565/pratik-bharodiya)13166 bronze badges[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)7

Just two commands worked for me. Currently I have composer 2.x.x , I had 1.10.x . First one command will download downgrade version and then second command will rollback to 1.x.x

1. `php composer self-update --1`
2. `composer self-update --rollback`

[Share](https://stackoverflow.com/a/65160615)[Improve this answer](https://stackoverflow.com/posts/65160615/edit)Follow[edited Oct 13, 2021 at 13:12](https://stackoverflow.com/posts/65160615/revisions)[![yivi's user avatar](https://i.sstatic.net/rHdZU.png?s=64)](https://stackoverflow.com/users/1426539/yivi)[yivi](https://stackoverflow.com/users/1426539/yivi)47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 5, 2020 at 18:38[![Amir Khan's user avatar](https://www.gravatar.com/avatar/81acc3ab5bd45a5d34bc3854c3319289?s=64\&d=identicon\&r=PG\&f=y\&so-version=2)](https://stackoverflow.com/users/10015466/amir-khan)[Amir Khan](https://stackoverflow.com/users/10015466/amir-khan)22111 silver badge44 bronze badges[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)Report this ad7

I found a flag in composer installer "--1" and "--2". I'm using this command inside of my Dockerfile:

```php
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --1
```

[Share](https://stackoverflow.com/a/69883236)[Improve this answer](https://stackoverflow.com/posts/69883236/edit)Followanswered Nov 8, 2021 at 12:10[![Sergiu Savva's user avatar](https://graph.facebook.com/1700682255/picture?type=large)](https://stackoverflow.com/users/3488373/sergiu-savva)[Sergiu Savva](https://stackoverflow.com/users/3488373/sergiu-savva)7111 silver badge22 bronze badges[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)4

You can use following code for update to specific versions

```php
composer self-update 1.10.12
composer self-update 2.0.7
```

or

```php
composer self-update --1 or 2
```

[Share](https://stackoverflow.com/a/72117134)[Improve this answer](https://stackoverflow.com/posts/72117134/edit)Followanswered May 4, 2022 at 17:28[![Rajath Kamal's user avatar](https://lh3.googleusercontent.com/a/AATXAJysAd0sKNunW0F2by-RPKsABXsnEy2DeyDC9ZUb=k-s64)](https://stackoverflow.com/users/16997948/rajath-kamal)[Rajath Kamal](https://stackoverflow.com/users/16997948/rajath-kamal)6511 bronze badge[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)1

## Use `phar` instead.

Download specific version of `composer.phar` file from : <https://getcomposer.org/download>

Place this phar file in your project root directory where you are trying to run composer install/update/require (or you can use fully qualified path for composer.phar while using it)

now instead of `composer require` use `php composer.phar require`

or for a specific version `php7.1 composer.phar require //replace with your specific version if required`

[Share](https://stackoverflow.com/a/73908084)[Improve this answer](https://stackoverflow.com/posts/73908084/edit)Follow[edited Sep 23, 2023 at 4:44](https://stackoverflow.com/posts/73908084/revisions)answered Sep 30, 2022 at 11:33[![bareMetal's user avatar](https://i.sstatic.net/lE1Iz.jpg?s=64)](https://stackoverflow.com/users/7338187/baremetal)[bareMetal](https://stackoverflow.com/users/7338187/baremetal)55111 gold badge77 silver badges2727 bronze badges[Add a comment](https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#)-1

The below command is used to update the specific version of the composer.

```php
composer self-update [version no of composer]
```

### Solution 2&#x20;

```
https://stackoverflow.com/questions/75258393/how-to-install-two-composer-in-one-windows-system
```

<figure><img src="https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2FyzhY4mMre83MCA4UsnFQ%2FMUKGS.png?alt=media&amp;token=73a20f97-af2c-45d6-8bd3-1c680a45736c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2FHOKKpVe8Ct4brOa6NI3i%2FjCIIW.png?alt=media&amp;token=f6962f4c-8b3b-4af9-b093-60e26ed1e184" alt=""><figcaption></figcaption></figure>

<figure><img src="https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2Fkg0F5siUcpobdDgC4FvL%2FzWovG.png?alt=media&amp;token=692f8b23-6b20-46b2-81bc-66cf0ebb418d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://55355946-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lk4gdXN1F2DaoesJ9Bz%2Fuploads%2FliKQVaNtgvpd19y2H51n%2FgX2bI.png?alt=media&amp;token=693d3eaa-9f3b-4d74-98c4-b6ccf6ff8f71" alt=""><figcaption></figcaption></figure>

### for windows do the following steps:

* [one](https://i.sstatic.net/Yclfs.png) -> (create `composer1` directory in C:\composer\_path)
* [two](https://i.sstatic.net/MUKGS.png) -> (copy three file in `composer` directory to `composer1` directory)
* [three](https://i.sstatic.net/jCIIW.png) -> (set path `composer1` to `environment variable`)
* [four](https://i.sstatic.net/zWovG.png) -> (run `composer1 self-update --1` in cmd) because Convert to version 1.0.0
* [five](https://i.sstatic.net/gX2bI.png) -> (test versions composer)
