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 trialnico dev
20,364 PointsConsole + 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:
- I am on Windows 10.
- My MAMP works great.
- My console, Git Bash, Windows Command Line, PHP command line, etc. do not follow.
- 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
Corey Cramer
9,453 PointsThe 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
20,364 PointsOh 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.
Corey Cramer
9,453 PointsYou'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.