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

Preview of PHP in Bracket How to preview the php file in my local browser? It did not work even after I type the path

So when I click preview. There was a window pop up and ask me to input the local file path (eg http://localhost:8000/) But even after I put my file path, the browser still said: "cannot connect". Anyone know how to solve it? Thank you so much

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Logan,

PHP requires a server to run. If you're developing locally, you will need to be running a local server in order to preview PHP pages. You don't specify which system you're operating, but Treehouse does have a quick workshop on local development. One for Mac or one for Windows.

Hope this helps. :) :dizzy:

Okay gotcha! Thank you so much! Basically, it means I have to set up for the local server environment in order to test my idea right?