XAMPP,Apache-錯誤:Apache意外關閉

本文翻譯自:XAMPP, Apache - Error: Apache shutdown unexpectedly

I've just re-installed XAMPP, and when I try to start my Apache server in the XAMPP Control Panel, I now get the following errors: 我剛剛重新安裝了XAMPP,當我嘗試在XAMPP控制面板中啓動我的Apache服務器時,現在出現以下錯誤:

16:50:25  [Apache]     Status change detected: running
16:50:26  [Apache]     Status change detected: stopped
16:50:26  [Apache]     Error: Apache shutdown unexpectedly.
16:50:26  [Apache]     This may be due to a blocked port, missing dependencies,
16:50:26  [Apache]     improper privileges, a crash, or a shutdown by another method.
16:50:26  [Apache]     Press the Logs button to view error logs and check
16:50:26  [Apache]     the Windows Event Viewer for more clues
16:50:26  [Apache]     If you need more help, copy and post this
16:50:26  [Apache]     entire log window on the forums

How do I solve this? 我該如何解決?


#1樓

參考:https://stackoom.com/question/1EmlN/XAMPP-Apache-錯誤-Apache意外關閉


#2樓

Follow these steps: 跟着這些步驟:

  1. Open your XAMPP control panel then click its "Config" 打開XAMPP控制面板,然後單擊其“配置”
  2. Choose the "Apache (httpd.conf)" and find this code below and change it into this one: 選擇“ Apache(httpd.conf)”並在下面找到此代碼,並將其更改爲以下代碼:

    #Change this to Listen on specific IP addresses as shown below #將其更改爲偵聽特定IP地址,如下所示

    #to prevent Apache from glomming onto all bound IP addresses. #防止Apache陷入所有綁定的IP地址。

    #Listen 0.0.0.0:80 #聽0.0.0.0:80

    #Listen [::]:80 #聽[::]:80

    Listen 80

    # Dynamic Shared Object (DSO) Support #動態共享對象(DSO)支持

    1. Save it ( Ctrl + S ) 保存( Ctrl + S
    2. After that, go back to the XAMPP control panel and click its config again. 之後,返回XAMPP控制面板並再次單擊其配置。
    3. Choose "Apache (httpd-ssl.conf)", find this code below, and change it again: 選擇“ Apache(httpd-ssl.conf)”,在下面找到此代碼,然後再次進行更改:

    # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two #注意:使用IPv6但不使用IPv4映射的地址的配置需要兩個

    # Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443" #監聽指令:“聽[::]:443”和“聽0.0.0.0:443”

    #

    #Listen 0.0.0.0:443 #聽0.0.0.0:443

    #Listen [::]:443 #聽[::]:443

    Listen 443

    1. Save it ( Ctrl + S ) 保存( Ctrl + S
    2. Then, click the "config" (note: above the netstat) and click the "service and port settings". 然後,單擊“配置”(注意:netstat上方),然後單擊“服務和端口設置”​​。
    3. Change "Main Port" to 8080 and "SSL Port" to 4433, then save it. 將“主端口”更改爲8080,將“ SSL端口”更改爲4433,然後將其保存。
    4. Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off". 最後,轉到“控制面板”->“程序和功能”->“打開或關閉Windows”。
    5. Uncheck your "Internet Information Services", and then click OK. 取消選中“ Internet信息服務”,然後單擊“確定”。

Just wait for it and your computer/laptop will be automatically restart and try to open your XAMPP control panel again, and then start your Apache. 只需等待它,您的計算機/筆記本電腦將自動重啓,並嘗試再次打開XAMPP控制面板,然後啓動Apache。


#3樓

One thing you can do is to stop the services on port 80 by issuing 您可以做的一件事是通過發出以下命令停止端口80上的服務

net stop http

in a cmd. 在一個cmd中。 You'll be asked if you're sure you want to stop those services. 系統將詢問您是否確定要停止這些服務。 I found out that I had a few services I wasn't using and disabled them. 我發現我有一些我沒有使用的服務並禁用了它們。

To see who else is using port 80 type in a cmd 要查看還有誰在使用端口80,請在cmd中鍵入

netstat -abno

I'm assuming you want to run Apache on port 80. If this is the case and you want to keep the conflicting services you will need to associate them to a new port. 我假設您想在端口80上運行Apache。如果是這種情況,並且想要保留衝突的服務,則需要將它們關聯到新端口。

If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. 如果問題不是繁忙的端口,您還可以嘗試以下操作:在XAMPP配置面板中選擇“顯示調試信息”。 When starting Apache you'll be shown something like "Executing "c:\\xampp\\apache\\bin\\httpd.exe". If you run that 啓動Apache時,將顯示類似“正在執行“ c:\\ xampp \\ apache \\ bin \\ httpd.exe”的信息。

c:\xampp\apache\bin\httpd.exe

in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file). 在cmd中,您將獲得更多信息(例如,我曾經有一個httpd.conf文件問題)。

Related: How do I free my port 80 on localhost Windows? 相關: 如何在本地主機Windows上釋放端口80? and Apache won't run in xampp Apache將無法在xampp中運行


#4樓

Open Skype. 打開Skype。

Tools -> Options -> Advanced -> Connection. 工具->選項->高級->連接。

Uncheck the " Use port 80 and 443 for alternatives for incoming connections " checkbox 取消選中“ 使用端口80和443替代傳入連接 ”複選框

Sign Out and Close all Skype windows. 退出並關閉所有Skype窗口。 Try restarting your Apache. 嘗試重新啓動Apache。


#5樓

For me, this problem began when I hosted a VPN-connection on my Windows 8 computer. 對我來說,當我在Windows 8計算機上託管VPN連接時,此問題就開始了。

Simply deleting the connection from "Control Panel\\Network and Internet\\Network Connections" solved the problem. 只需從“控制面板\\網絡和Internet \\網絡連接”中刪除連接即可解決此問題。


#6樓

My problem was that in httpd.conf the DocumentRoot and <Directory> entries were pointing to non-existing folders. 我的問題是在httpd.conf中, DocumentRoot<Directory>條目指向不存在的文件夾。

For example, the 'original' httpd.conf had the following entries: 例如,“原始” httpd.conf具有以下條目:

DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">

If you've installed in C:\\xampp then you need to change those entries to match, ie 如果您已安裝在C:\\ xampp中,則需要更改這些條目以使其匹配,即

DocumentRoot "c:/xampp/htdocs"
<Directory "c:/xampp/htdocs">
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章