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 PHP on the Web HTML and PHP

Can't display the PHP result if using local server

Hi,

I am trying to follow along this tutorial with using XAMPP and sublime text editor. but when i renamed the file extension to index.php , it didn't display properly. here is the screenshot of my problem

https://ibb.co/h5Emxm

what went wrong in here ? Thanks in advance :)

case closed. I have found the problem, newbie mistake.

3 Answers

I was also having this problem using XAMPP awhile back. What I did was make a copy of my whole php folder in the htdocs inside the XAMPP folder and call it using localhost/nameoffolder and it worked fine! Glad you were able to solve your issue. :)

easiest way

php -S localhost:3000
// 3000 can be replaced by any other valid port number of your choosing. More information is in man php

you can also .start a python server if you have it installed .

https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server

You access your files through the localhost. For that you need to type in the browser: localhost:80/hello.php Assuming your port is 80 of course. It is considered good practice to avoid naming your files as index.php since you will not see them in your localhost.