Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
311 views
in Technique[技术] by (71.8m points)

php - Apache shutdown unexpectedly

I am using XAMPPS to host PHP files from my machine. I have recently installed XAMPPs but I am unable to start Apache service as port 80 is in use by PID 4 - NT Kernel & System.

I know by using a different port (such as port 8080 etc change in httpd.conf) will get to a workaround for this issue. However I need port 80 to be released by PID 4 process and allocated to Apache service. I have done that in the past but have forgotten the resolution steps over the time. Please help me fix it

This is the error I am encountering while starting Apache

`11:19:52 AM  [Apache]  Error: Apache shutdown unexpectedly.`
`11:19:52 AM  [Apache]  This may be due to a blocked port, missing dependencies,` 
`11:19:52 AM  [Apache]  improper privileges, a crash, or a shutdown by another method.`
`11:19:52 AM  [Apache]  Press the Logs button to view error logs and check`
`11:19:52 AM  [Apache]  the Windows Event Viewer for more clues`
`11:19:52 AM  [Apache]  If you need more help, copy and post this`
`11:19:52 AM  [Apache]  entire log window on the forums`

Logs from apache error log file:

[Wed Jul 03 00:54:17.004882 2013] [mpm_winnt:notice] [pid 248:tid 240] AH00354: Child: Starting 150 worker threads.
[Wed Jul 03 01:17:37.485351 2013] [mpm_winnt:notice] [pid 4200:tid 228] AH00428:    Parent: child process 248 exited with status 1073807364 -- Restarting.
[Wed Jul 03 08:51:45.875976 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:46.188476 2013] [core:warn] [pid 400:tid 228] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Jul 03 08:51:46.844726 2013] [ssl:warn] [pid 400:tid 228] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00455: Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16 configured -- resuming normal operations
[Wed Jul 03 08:51:49.047851 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00456: Server built: Feb 23 2013 13:07:34
[Wed Jul 03 08:51:49.047851 2013] [core:notice] [pid 400:tid 228] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache
[Wed Jul 03 08:51:49.063476 2013] [mpm_winnt:notice] [pid 400:tid 228] AH00418: Parent: Created child process 5384
[Wed Jul 03 08:51:50.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.579101 2013] [ssl:warn] [pid 5384:tid 240] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Jul 03 08:51:51.750976 2013] [mpm_winnt:notice] [pid 5384:tid 240] AH00354: Child: Starting 150 worker threads.

NOTE: I DO NOT HAVE IIS, WEB CLIENT, WORLD WIDE WEB SERVICE.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

on your XAMPP control panel, next to apache, select the "Config" option and select the first file (httpd.conf):

there, look for the "listen" line (you may use the find tool in the notepad) and there must be a line stating "Listen 80". Note: there are other lines with "listen" on them but they should be commented (start with a #), the one you need to change is the one saying exactly "listen 80". Now change it to "Listen 1337".

Start apache now.

If the error subsists, it's because there's another port that's already in use. So, select the config option again (next to apache in your xampp control panel) and select the second option this time (httpd-ssl.conf):

there, look for the line "Listen 443" and change it to "Listen 7331".

Start apache, it should be working now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...