Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

pn523's avatar
Level 2

Change composer php version without uninstalling composer

Hi, this is not a question but a solution that i found, i think will help someone :

  1. Search for system environment variables in cortana.

  2. Click on the button "Environment variables".

  3. Under "System variables" select path and click on edit, you will see one entry like this "C:\wamp\bin\php\php5.6.13".

  4. Just change this to the folder name of the php located at your wamp/bin/php7.1.9, here bin7.1.9 is folder name.

  5. Replace php5.6.13 with bin7.1.9, it will look like these "C:\wamp\bin\php\php7.1.9", just click ok on all the boxes.

  6. You are done.

  7. To verify, first close all the cmd windows, than open cmd and type "php -v", press enter and you should see php7.1.9.

  8. If you don't see change in php version than just restart your pc and run php -v again in cmd , it will work.

0 likes
2 replies

Please or to participate in this conversation.