Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
nico dev20,360 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.
- 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!
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 dev20,360 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.