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 trialagung laksana
Courses Plus Student 179 PointsCan'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
what went wrong in here ? Thanks in advance :)
3 Answers
Dennis Amiel Domingo
17,813 PointsI 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. :)
Yoan Herrera
21,137 Pointseasiest 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
Emil Pesaxov
3,684 PointsYou 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.
agung laksana
Courses Plus Student 179 Pointsagung laksana
Courses Plus Student 179 Pointscase closed. I have found the problem, newbie mistake.