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

nico dev
nico dev
20,364 Points

Console + PHP + MAMP (on Win)

Hello there everyone,

I want to start this question by confessing I feel like a total dumb today :D

I have been for hours trying to figure out how to follow along with Alena on my computer.

In this video she's doing some PHP scripting on Workspaces console, and also obviously editing the PHP file. Also, I just installed the MAMP and set it up so I can see there anything browser related having my 'virtual local server'.

All went right except I tried doing the PHP scripting in my command line (I am on Windows 10) and get that 'php is not a command' classic message. I tried my Git Bash, and a similar message, so I finally decided going to the source and downloaded some kind of php console from the php site, but whatever I type in that console, it will only display it in the console, but when I hit return it does absolutely nothing.

I know I am probably and ridiculously missing something obvious (or not so much maybe?) but I can't pinpoint exactly what it is? How to follow along her in the console?

NOTE: My MAMP is already set up correctly; I already tested it.

Summary:

  1. I am on Windows 10.
  2. My MAMP works great.
  3. My console, Git Bash, Windows Command Line, PHP command line, etc. do not follow.
  4. How to follow along the teacher in my own computer (for the sake of practice gained 'on my own')?

Thank you in advance!

2 Answers

The piece that it sounds like you're missing is adding PHP to your environment variables. I have some instructions below. After that open command prompt/powershell and type php -v to verify that it worked properly.

Press the windows key (or click on Cortana if you still have that enabled) and type: environment

Towards the bottom of the window that pops up there is a button called "Environment Variables...", click on that.

Now for either your specific user or system wide find the variable called Path, click that and click edit.

At the very end add a semicolon (;) and then the full path to your PHP installation (e.g C:\Program Files\php)

Click "OK" on all windows until everything is closed
nico dev
nico dev
20,364 Points

Oh man, I can't thank you enough Corey!!

This is second time you show me the way, and help me get out of my maze.

Thank you man! That did the trick. Now I can use it both from the cmd or from the Git bash itself.

You're very welcome, I'm glad I could be of help more than once! If you have any other questions just post them up and I'll help where I'm able.