Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics Getting to Know PHP Intro to Workspaces and PHP Code

Command-line on Windows

There is a way to execute PHP on windows prompt? How it works? What I have to install?

2 Answers

First you need to download PHP and save it somewhere (e.g C:/php)

  • Go to Control Panel and open the System icon (Start → Control Panel)
  • Go to the Advanced tab
  • Click on the 'Environment Variables' button
  • Look into the 'System Variables' pane
  • Find the Path entry (you may need to scroll to find it)
  • Double click on the Path entry
  • Enter your PHP directory at the end, including ';' before (e.g. ;C:\php)
  • Press OK
  • Restart your computer

Next time you open the command prompt type the following command to verify that it is working properly:

php -v

Thank you, I will try.