php Apache 意外关闭
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17440727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apache shutdown unexpectedly
提问by Dragan Kidovic
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.
我正在使用 XAMPPS 从我的机器上托管 PHP 文件。我最近安装了 XAMPP,但我无法启动 Apache 服务,因为 PID 4 - NT 内核和系统正在使用端口 80。
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
我知道通过使用不同的端口(例如 httpd.conf 中的端口 8080 等更改)将解决此问题。但是,我需要端口 80 由 PID 4 进程释放并分配给 Apache 服务。我过去这样做过,但随着时间的推移忘记了解决步骤。请帮我修复它
This is the error I am encountering while starting Apache
这是我在启动 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:
来自 apache 错误日志文件的日志:
[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.
注意:我没有 IIS、网络客户端、全球网络服务。
回答by chiapa
on your XAMPP control panel, next to apache, select the "Config" option and select the first file (httpd.conf):
在 XAMPP 控制面板上,在 apache 旁边,选择“配置”选项并选择第一个文件 (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".
在那里,查找“listen”行(您可以使用记事本中的查找工具),并且必须有一行说明“Listen 80”。注意:还有其他带有“listen”的行,但它们应该被注释(以 # 开头),您需要更改的是准确地说“listen 80”的那一行。现在将其更改为“听 1337”。
Start apache now.
现在启动apache。
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):
如果错误仍然存在,那是因为有另一个端口已在使用中。因此,再次选择配置选项(在 xampp 控制面板中的 apache 旁边),这次选择第二个选项 (httpd-ssl.conf):
there, look for the line "Listen 443" and change it to "Listen 7331".
在那里,查找“Listen 443”行并将其更改为“Listen 7331”。
Start apache, it should be working now.
启动 apache,它现在应该可以工作了。
回答by user3210452
If you are using the latest Skype, go to:
如果您使用的是最新版 Skype,请访问:
Tools -> Options -> Advanced -> connection.
工具 -> 选项 -> 高级 -> 连接。
Disable the 'Use port 80 and 443 for alternatve.. '
Sign Out and Close all Skype windows. Try restart your Apache again.
禁用“使用端口 80 和 443 作为替代...”
退出并关闭所有 Skype 窗口。再次尝试重新启动 Apache。
回答by kimiberi
Follow these:
遵循这些:
- open your xampp control panel then click its "config"
choose the "Apache (httpd.conf)" and find this code below and change it into this one:
# Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 0.0.0.0:80 #Listen [::]:80 Listen 80 # # Dynamic Shared Object (DSO) Support
save it (ctrl + s)
after that, go back to xampp control panel and click again its config
choose "Apache (httpd-ssl.conf)" find this code below and change it again:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" # #Listen 0.0.0.0:443 #Listen [::]:443 Listen 443
save it (ctrl + s)
then, click the "config" (note: above the netstat) and click the "service and port settings" then save both of it.
finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
Uncheck your "Internet Information Services" then click ok.
- 打开您的 xampp 控制面板,然后单击其“配置”
选择“Apache (httpd.conf)”并在下面找到此代码并将其更改为以下代码:
# Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 0.0.0.0:80 #Listen [::]:80 Listen 80 # # Dynamic Shared Object (DSO) Support
保存 (ctrl + s)
之后,返回 xampp 控制面板并再次单击其配置
选择“Apache (httpd-ssl.conf)”在下面找到此代码并再次更改:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" # #Listen 0.0.0.0:443 #Listen [::]:443 Listen 443
保存 (ctrl + s)
然后,单击“配置”(注意:在 netstat 上方)并单击“服务和端口设置”,然后保存它们。
最后,转到“控制面板”->“程序和功能”->“打开或关闭 Windows”。
取消选中“Internet 信息服务”,然后单击“确定”。
Just wait for it and your computer/laptop will be automatically restart and try to open again your xampp control panel then start your Apache.
只需等待它,您的计算机/笔记本电脑将自动重新启动并尝试再次打开您的 xampp 控制面板,然后启动您的 Apache。
回答by UdayKiran Pulipati
It means port 80 is already used by another one.
这意味着端口 80 已被另一个端口使用。
Simply follow these steps:
只需按照以下步骤操作:
- Open windows -> click on Run(win + R) -> type services.msc
- Goto IIS Admin-> Right click on it and click on StopOption.
- Open XAMPPclick on Start Action of ApacheModule, Apache Module is run.
- 打开 windows -> 点击Run(win + R) -> 输入services.msc
- 转到IIS Admin-> 右键单击它并单击停止选项。
- 打开XAMPP点击ApacheModule的Start Action ,Apache Module就运行了。
OR
或者
For find the port of Apache (80) in Command Promptsimply type netstat -aonit displays present used ports on windows, under Local Address columnit shown as 0.0.0.0:80. If it displays this port another connection is already used this port number.
要在命令提示符中查找 Apache ( 80)的端口,只需键入netstat -aon它会在 Windows 上显示当前使用的端口,在“本地地址”列下显示为0.0.0.0:80。如果显示此端口,则另一个连接已使用此端口号。
Active Connections in Windows XP:
Windows XP 中的活动连接:
I solved my problem after installing xampp-win32-1.6.5-installerpreviously I used xampp version xampp-win32-1.8.2-0-VC9-installerat that time I got this error. Now it resolved my problem.
我在安装xampp-win32-1.6.5-installer后解决了我的问题,之前我使用了 xampp 版本xampp-win32-1.8.2-0-VC9-installer当时我收到了这个错误。现在它解决了我的问题。
回答by Truong Tran
You shuld run file setup_xampp.batin XAMP folder first!
您shuld运行文件setup_xampp.bat在XAMP文件夹第一!
回答by Thiago Augustus Oliveira
On your XAMPP control panel, next to apache, select the "Config" option and select the first file (httpd.conf):
在您的 XAMPP 控制面板上,在 apache 旁边,选择“配置”选项并选择第一个文件 (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".
在那里,查找“listen”行(您可以使用记事本中的查找工具),并且必须有一行说明“Listen 80”。注意:还有其他带有“listen”的行,但它们应该被注释(以 # 开头),您需要更改的是准确地说“listen 80”的那一行。现在将其更改为“听 1337”。
Start apache now.
现在启动apache。
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):
如果错误仍然存在,那是因为有另一个端口已在使用中。因此,再次选择配置选项(在 xampp 控制面板中的 apache 旁边),这次选择第二个选项 (httpd-ssl.conf):
there, look for the line "Listen 443" and change it to "Listen 7331".
在那里,查找“Listen 443”行并将其更改为“Listen 7331”。
Start apache, it should be working now.
启动 apache,它现在应该可以工作了。
回答by tawa
In my situation I had moved the htdocsto a new location updated in httpd.conf, which worked fine. I then received the same error after updating the httpd-vhost.conffile.
在我的情况下,我已将htdocs移到了httpd.conf 中更新的新位置,该位置运行良好。然后我在更新httpd-vhost.conf文件后收到了同样的错误。
I found that the error was caused by a typo in the vhost configuration file. Previously I changed all "DocumentRoot" 's to the new htdocslocation, but had forgot to update the new location for "ErrorLog". After correcting the missing path, Apache was running smooth again.
我发现该错误是由 vhost 配置文件中的错字引起的。以前我将所有 "DocumentRoot" 更改为新的htdocs位置,但忘记更新 "ErrorLog" 的新位置。更正缺失的路径后,Apache 再次运行顺畅。
回答by innermond
I had a similar issue (that is the reason I come to this thread) that originated from a typo in httpd-vhosts.conf
我有一个类似的问题(这就是我来到这个线程的原因)源于 httpd-vhosts.conf 中的一个错字
instead of <VirtualHost domain-name:80
> I accidentally wrote (through copy-paste) as <domain-name *:80
>
而不是<VirtualHost domain-name:80
> 我不小心写(通过复制粘贴)为<domain-name *:80
>
回答by user3183404
This problem may occur because of skype installation in the system. Skype and apache service always conflict. Make sure your skype is not started before starting xampp.
由于系统中安装了Skype,可能会出现此问题。Skype 和 apache 服务总是冲突。在启动 xampp 之前,请确保您的 Skype 没有启动。
回答by Waqas Bukhary
Your XAMPP restarting with following error at Multi-Processing Module
mpm
您的 XAMPP 在Multi-Processing Module
mpm处重新启动并出现以下错误
[mpm_winnt:notice] [pid 4200:tid 228] AH00428:
`Parent: child process 248 exited with status 1073807364 -- Restarting.`
Add the following in the httpd.conffile of xampp to resolve this.
在xampp的httpd.conf文件中添加以下内容来解决这个问题。
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>