Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.