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 Build a Simple PHP Application Getting Started with PHP Install PHP on Windows 7

Issue Running XAMPP

Hi,

I followed instructions exactly as shown in video. -Downloaded latest XAMPP package -Installed on Windows 7 -Provided "Public" access during Firewall warning -Restarted computer

I am getting the following error when I try to run Apache Server through XAMPP Control Panel: 7:11:45 PM [Apache] Error: Apache shutdown unexpectedly. 7:11:45 PM [Apache] This may be due to a blocked port, missing dependencies, 7:11:45 PM [Apache] improper privileges, a crash, or a shutdown by another method. 7:11:45 PM [Apache] Press the Logs button to view error logs and check 7:11:45 PM [Apache] the Windows Event Viewer for more clues 7:11:45 PM [Apache] If you need more help, copy and post this 7:11:45 PM [Apache] entire log window on the forums

Would appreciate some help.

Thanks.

3 Answers

Nevermind. There was an issue with the default port. I was able to update the port settings and that fixed the issue.

Erin Avery
Erin Avery
7,603 Points

Could you please elaborate on how you updated the port settings? I'm having the same issue.

Thanks!

Just to add my own experience, I've had issues with xampp running and Skype. Quit Skype, start Apache and then runs fine, can even start Skype after that. But certainly Skype doesn't like the default ports used in Apache. Just as extra info for anyone that has similar issues.

Jason Cook
Jason Cook
11,403 Points

For anyone having this issue who has not found resolution by the time you reach this posting, then read this carefully. The two most common issues that cause this problem is (Skype & World Wide Web Publishing Service "IIS" running). Here's what you need to check (below).

1) Go to Computer Management > Services and make sure that IIS is not running (will be listed as World Wide Web Publishing Service). If this is running, it will give the exact error since it will be demanding exclusive access to the default ports used with HTTP/HTTPS which is 80/443.

2) If you have Skype installed, go to Tools > Options > Advanced > Connection (if already logged in), or if at the sign in screen simply go to Tools > Connection Options. Next, look for a checkbox with the description Use port 80 and 443 for additional incoming connections and make sure this is unchecked. This is typically checked in order to allow users to bypass firewalls and other constraints.

Alternative (Fall Back) Solution

If these two issues don't allow you to get Apache started (using ports 80, 443) then you can always click Config and select the Apache (httpd.conf) and make the following two changes to use a different port such as what the stackoverflow article describes in the link that Erin posted previously.

a) Replace "Listen 80" with "Listen 8080"

b) Replace "ServerName localhost:80" to "ServerName localhost:8080"

c) Save httpd.conf file (CTRL + S).

d) Start Apache

If using this solution, here's how you will access your web server: http://localhost:8080/ (you must add the port as in this example when using non-default values).

One of these options will most likely solve your problem, but if not there are additional things you can try (e.g. msconfig selective startups etc) but you should be up and running at this point.

Good Luck!