Switching php version that used by composer on windows
I have 2 xampp where the first has the latest php and the other has php 5.6, and in my env path i have both of them, so when i type php -v it show the latest php, and when i type php56 -v it show php 5.6, but when i use composer it will only use the latest version, to change that i need to change env path of the latest version, is there any other solution ?
You can use the --php flag when running composer commands to specify which version of PHP you want to use. For example, if you wanted to use PHP 5.6, you would run the following command:
composer --php=php56 <command>
This will tell Composer to use the version of PHP specified in the --php flag instead of the version specified in the PATH environment variable.