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

Jesse Thompson
Jesse Thompson
10,684 Points

Setting up php console in brackets

Does anyone know the best way to set up a console for php in brackets? Also, live preview was so convenient for HTML but now I have no idea how to make it work for php. I just have to refresh the local server for now, anyone know if this functionality is possible?

I have it set up in WAMP on server 8080 and I go to C:/wamp/www/folder/file to open it. Seems that live preview doesnt work for php.

edit: I figured out how to use live preview for php. I just had to open the project folder by itself without the other files, set it to localhost:8080/projectfolder/

Still a little confused about php console though. The console in browser is just a javascript console so it doesnt work.

Jesse Thompson:

Glad you figured it out on your own. Instructors are very specific with their instructions. You can always stop & rewind the video multiple times to review it or the video transcript.

I also recommend that when you ask a question, use the name of the module (PHP Basics or Beginner PHP), the section name, & the lesson name like this: PHP Basics > Section Name > Lesson Title. It's far easier to find questions to answer & know exactly which lesson you're stuck in.

2 Answers

Jesse Thompson
Jesse Thompson
10,684 Points

Right now I am at PHP basics > Getting to Know PHP. Essentially she started using the console to run php code. I figured out a way though. I have WAMP installed on my computer. I put the php folder under C and what I do in the cmd is:

C:\php5.6.31\php c:\wamp64\www\hello\hello.php to do exactly what she is doing in workspaces. It runs the file in cmd when I do this. Ill figure out a faster way in the future.

Jesse Thompson
Jesse Thompson
10,684 Points

I actually still have no idea how to use the php console.

I try using the dev tools in brackets and type php hello.php but that gives an error because its just a javascript interpreter.

Jesse Thompson

Which Beginner PHP lesson are you on where you had the problem?