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 Unit Converter Integers

Console does not show the result

Hi, i am running a simple script: <?php $z = "hello"; echo $z; ?> but when i try to run it in console nothing happens. i receive just an empty output:
treehouse:~/workspace$ php 1.php
treehouse:~/workspace$

what is wrong?

Andrew Young
Andrew Young
Courses Plus Student 639 Points

I think echo function in PHP is showing the result on web browser

4 Answers

Pawandeep ShopWired
PLUS
Pawandeep ShopWired
Courses Plus Student 9,848 Points

Have you checked that you have saved the file before you are outputting from the console

Erik Robles
Erik Robles
Courses Plus Student 10,635 Points

This stumped me too until I saved. Thanks for the insight.

no. the teacher uses it in his lessons and it works fine in console.

Are you sure that is the name of the file? If it is, this might be a problem with Workspaces. If it doesn't work after you restart Workspaces, I would advise you to reach out to Treehouse Support.

Logan Jame
Logan Jame
252 Points

I have the same issue.... no matter what i do, it doesn't show the result in the Console