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 localhost connection refused

So I followed the PHP Track, in Build a Simple PHP Application Course, I installed XAMPP; then in Database Foundations I installed the MySQL packages with windows installer. After I completed this course, I found that I can't connect to localhost or 127.0.0.1, the site says *(111) Connection refused

The remote host or network may be down. Please try the request again*;

Then I uninstalled MySQL Packages, failed to connection again, then I uninstalled and reinstalled xammp, still doesn't work.

I googled "xampp localhost connection refused" and seems no answer suit my problem, what should I do to solve the problem?

3 Answers

Could be a number of Windows issues. Hard to tell without looking at your configuration. Try downloading and using WAMP instead. I use WAMP on one of my computers because it had issues with XAMPP.

Problem solved. When I installed WAMP, It says that i don't have msvcr110.ddl. Seems I somehow lost this library file, so I googled and installed "Visual C++ Redistributable for Visual Studio 2012 Update 4", Now Xampp work.

Harold Walters
Harold Walters
4,398 Points

Were you able to connect to localhost prior to installing MySQL? Confirm that Apache is actually running; programs such as Skype, and some others, use the same port as Apache, which prevent the service from running.

Simon Latham
PLUS
Simon Latham
Courses Plus Student 6,261 Points

I was having the same issue, getting the "... Connection refused" error message. When I checked the XAMPP status page, MySQL database was deactivated! So I uninstalled XAMPP, disabled internet access, disabled my antivirus program and Tonido Network, then reinstalled XAMPP and checked the status page; MySQL database was activated! I then created a database, created a folder in htdocs and was successfully able to install my Joomla! CMS.

Moral: it might be a good idea to ensure everything that's network dependent is disabled prior to installing XAMPP and anything associated.