Add XAMPP PHP to Environment Variables in Windows 10

Image for post
Image for post

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.

Image for post
Image for post

Scroll down to the Path variable and click Edit.

Image for post
Image for post

Click on the Browse button.

Image for post
Image for post

Navigate to C:/xampp/php and click OK.

Image for post
Image for post

You will now see the path to php inside the window. Click OK to exit.

Image for post
Image for post

Restart your Command Prompt window if it’s open and type in:

php -v

You should see the PHP version being displayed.

Image for post
Image for post

You can now use php from CMD.

Written by

Author of An Illustrative Introduction to Algorithms. A Software Engineer with a B.S. in Computer Science, a minor in Biology, and a passion for learning.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store