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 PHP Comments

When I run a php block in the console, it doesn't show the output

How can I get the console to show the output after typing "php <file name>.php" ?

Michael Cockrell
Michael Cockrell
Courses Plus Student 542 Points

or just read the 5000 other questions asking the same thing that give the exact same answer.

1 Answer

Amy Kelly
Amy Kelly
3,588 Points
  1. First make sure that the document is saved (if it is not saved it will have a red dot by the file name at the top)
  2. Save it by clicking ctrl s or by going to file then save.
  3. Then go into the console and type php <file name>.php and enter. The amount of times I have gone to run the code but it doesn't appear as I haven't saved the file :)