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 trialJessica Diaz
618 PointsWhy is the console not executing the simple script I'm typing that goes along with the PHP Basics tutorial?
I just started PHP Basics tutorial video. Opened the console for the first time. I typed in php hello.php right after the treehouse: ~/workspace$ When I try to execute this, nothing happens when I press enter, treehouse: ~ /workspace$ appears again
3 Answers
-- --
12,382 PointsHi Jessica,
Perhaps you forgot to save the file containing your code before trying to execute it? :)
Jessica Diaz
618 PointsThis really helped. I did forget to save it. Thanks so much
-- --
12,382 PointsHaha, no problem! :)
Jessica Diaz
618 PointsHi Mace, Would you happen to know a shortcut for saving scripts that doesn't include going up to File and pressing Save? Also, do you know of a shortcut to duplicate a line of code? It seems that the teacher's in the video know these shortcuts. Thanks so much. I really appreciate your help
-- --
12,382 PointsHey Jessica,
Sorry for the late reply! To save a file, press CTRL + S (or CMD + S on a Mac). I'm not sure if you can actually duplicate lines of code in Workspaces, though - I simply used 'copy paste' while using the Workspaces. (Edit: I tried a couple of things and apparently the shortcut on a Mac is CMD + D - this doesn't duplicate the code onto a new line, though - but I'm not sure if CTRL + D works on a Windows machine, too).
I tend to work locally (you can use XAMPP on Windows or MAMP if you're using a Mac), though, so I download the files and edit them in an actual text editor (these have more commands). I personally use Atom (and use CMD + Shift + D to duplicate a line of code / code block onto a new line), but you might like Sublime or Brackets better.
~ Mace