Windows another PHP version and Composer

In this short but effective article there is a command that will help you use a different php version than the basic one that is installed in windows and composer.

C:\wamp64\bin\php\php8.1.13\php.exe C:\ProgramData\ComposerSetup\bin\composer.phar command...

Here we see that we are using the PHP version from the wamp65 software, if the php version you want to use is in another folder, then adjust the first part. The second part should be the same for you.

The third part where the command is, it can be whatever you want, for example "update" or "create-project" means any further command in the composer itself.

If composer.phar is not there, you can find out through "Environment variables" when you type in start and immediately enter, then you will have the button "Environment variables" in "System Variables" (second column), find PATH written on the left side and go to edit there you will see where your composer folder is and then just add "composer.phar" at the end so that it looks like the command at the beginning.

Scroll to Top