Make sure there is no path of any PHP version already added to
SYSTEM PATH&USER PATHboth Environmental Variables. Because this tool won't ever effectSYSTEM PATH. But it is recommended to keep a backup ofUSER PATH
Just copy and paste switcher.exe file somewhere where you can access it easily.
Recommended: Put it inside a separate folder and add that folder's path to
PATHEnvironmental Variable (So you can access it everywhere)
- Add a version to switcher's local database
switcher add --version=74 --path=C:\tools\php74
- Activate (switch to) the version any time like this (Restart or Open a new terminal to see effects for CLI)
switcher set --version=74
You can deactivate all activated versions this way
switcher unset
You can list all versions available in database
switcher list
switcher --help
If you want to build it then make sure to use -static-libgcc and -static-libstdc++ flags. For example,
g++ switcher.cpp -o switcher -static-libgcc -static-libstdc++
