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

xampp not working, tried hundreds of fixes but localhost still won't run

For some reason, I can't get xampp to work which is obviously a problem because I want to develop using php locally. I'm running windows 7 and i've tried switching the default apache port to 8080 and then I get an error saying "Oops! Google Chrome could not connect to localhost:8080". Before when it was on port 80, when I tried accessing localhost, the page would just infinitely load. I've been trying to fix this for an hour, but I can't seem to figure it out. What do I do?

4 Answers

Hi,

I had problem with XAMP last summer when I was working on a project...the culprit? SKYPE!!

So, if you have Skype running close it and see if that fixes the problem. Hope that helps.

I've changed the port that skype runs on, as well as exited out of it, but it still doesn't work

If I were you I would try to disable all non-MS services and programs and see if it works. If it does, then you can go through and little by little start adding services in until you find what makes it stop working.

Start-->Run-->MSConfig

IN MSCONFIG Services-->Check "Hide all Microsoft Services"-->Disable all

Start up-->Disable All

If stopping all services doesn't resolve it then I would think that it is an issue with the xamp configution (although, that should not be an issue if you kept default settings).

Perhaps an antivirus or firewall is causing some kind of issue as well. If you have an AV/FW installed check the logs and see if it is blocking anything.

This tutorial helped me when I first installed xampp. Probably has to do with you needing a database and then a specific file to pull from for that database. They go over this a bit in the php application tutorial here, but anyway, here's the link. http://complete-concrete-concise.com/web-tools/creating-a-mysql-database-using-xampp

You're going to need the filename in your htdocs folder of xampp and the url should look something like http://localhost/YOUR_DATABASE_NAME

Faizal Heesyam
Faizal Heesyam
8,843 Points

just wanna make sure how did you change the port? if its through the httpd.conf file, and under the ServerName (ex: localhost:8080..etc), there should be no problem as all you have to do after that is restart your Apache server..

I changed it back to port 80 cause it didn't work on port 8080. The point is, it's not working but I just don't know why, and I really don't know what to do cause at this point I'm kinda stuck and feel like quitting.

Faizal Heesyam
Faizal Heesyam
8,843 Points

perhaps looking into the apache log file would explain something..

dont give up.. :)

I don't understand any of this stuff though haha, i'm not a pro, quite the opposite.

Faizal Heesyam
Faizal Heesyam
8,843 Points

it reads port 80, but not 8080.. i still believe the solution is right inside httpd.conf.. maybe you can share your config file, host it somewhere on github, and maybe share us the gist?

or just simply paste everything inyour httpd.conf and paste it on pastebin.. :)

Okay, I've uninstalled xampp, deleted the folder off my computer permanently, rebooted my computer, and now reinstalled it. Localhost is still not working. Here is the httpd.conf file. http://pastebin.com/AtF4u5Ws

Faizal Heesyam
Faizal Heesyam
8,843 Points

usually if i want to change port from default 80 to something else, i would pay attention to:-

Line 58: Listen **80* * Line 214: ServerName **localhost:80* *

edit these, save. restart Apache, it should work.

Changed it to 8080 in the config on both those lines...still doesn't work.

Go to your FILES inside the C: and make sure that the HTDOCS is inside of the xammp file!