Configuring XAMPP PHP in Windows 10 Environment Variables
If you’re using XAMPP on your Windows 10 machine, and would like to add the php command so that it’s usable in command prompt, you’re in the right place.
Start by typing in Environment Variables in your Search and click on the Edit the system environment variables result.
In the System Properties window click Environment Variables. Make sure that you’re on the Advanced tab.
Scroll down to the Path variable and click Edit.
Click on the Browse button.
Navigate to C:/xampp/php and click OK.
You will now see the path to php inside the window. Click OK to exit.
Restart your Command Prompt window if it’s open and type in:
php -v
You should see the PHP version being displayed.
You can now use php from CMD.