在Windows上安装 XAMPP 控制面板后,许多用户报告在启动(installing the XAMPP Control Panel)Apache时遇到错误。当World Wide Publishing Service(World Wide Publishing Service)等进程在设备的 80 端口中持续运行时,通常会出现此问题。因此,Windows 11/10操作系统不允许Apache服务器执行,从而导致错误。
5:38:38 PM [Apache] Error: Apache shutdown unexpectedly.
5:38:38 PM [Apache] This may be due to a blocked port, missing dependencies,
5:38:38 PM [Apache] improper privileges, a crash, or a shutdown by another method.
5:38:38 PM [Apache] Press the Logs button to view error logs and check
5:38:38 PM [Apache] the Windows Event Viewer for more clues
5:38:38 PM [Apache] If you need more help, copy and post this
5:38:38 PM [Apache] entire log window on the forums
实际上,计算机上的80 端口也曾经是(Port 80)Apaches模块在XAMPP上使用的默认TCP/IP端口。而且由于两个不同的应用程序不能使用相同的网络端口,因此您必须在启动XAMPP的Apache服务器之前停止它。如果您的设备也遇到此问题,我在本指南中提到了一些简单的解决方法。那么,让我们开始吧。
Apache未从XAMPP 控制面板启动(XAMPP Control Panel)
清除万维网发布服务(World Wide Web Publishing Service)将是重新启动Apache的最佳方法。但是,您也可以通过更改TCP/IP端口号或在需要时停止服务来获取它。因此,要修复Apache无法在XAMPP 控制面板(XAMPP Control Panel)上启动,请遵循以下所有可能的方法:
- 清除万维网服务
- 更改默认的Apache TCP/IP端口
- 停止万维网发布服务(Stop World Wide Web Publishing Service)
让我们详细了解它们。
1]清晰的万维网服务
为了解决Apache服务的启动问题,您必须从您的设备中清除万维网(Wide Web) 服务。(Services)但在开始之前,请确保您没有任何依赖此服务的应用程序。
如果一切正常,请打开Windows 系统上的控制面板。(open the Control Panel)
打开后,选择在大图标(Large icons)或小图标选项中查看(Small icons)控制面板(Control Panel),以便您可以看到所有控制面板(Control Panel)项目。
从可用项目中,选择程序和功能(Programs and Features)选项。
在左侧边栏中,有一个名为Turn Windows features on or off的链接,点击它。
在Windows 功能(Windows Features)对话框中,展开Internet 信息服务(Internet Information Services)字段。
现在,清除有关万维网服务(World Wide Web Services)的复选框,然后单击确定(OK)按钮保存更改。
完成上述步骤后,重新启动设备。之后,打开XAMPP 控制面板(XAMPP Control Panel)并单击Apache上的(Apache)开始(Start)按钮。它现在应该在您计算机上的端口 80 中运行。
2]更改(Change)默认的Apache TCP/IP端口
如果由于任何原因,上述方法解决方法对您不起作用,您需要将Apache配置为在不同的TCP/IP端口上执行。因此,请遵循以下建议:
在Windows设备上打开XAMPP 控制面板。(XAMPP Control Panel)
单击 Apache 模块的Config按钮。
从弹出菜单列表中选择Apache (httpd.conf)选项。(Apache (httpd.conf))
在以下记事本页面上,您需要找到Listen 80。
要使搜索更容易,请按Ctrl+F快捷键。在弹出菜单中,输入您要搜索的内容。标记(Mark) 环绕(Wrap around)复选框,不选中匹配大小写(Match case),然后单击查找下一个(Find Next)按钮。
找到相应的行后,使用您选择的任意数字更改端口号。
例如,您可以尝试端口 121。那么TCP/IP端口号的相应结果将类似于 - Listen 121。
Press Ctrl+S快捷键将更改保存在记事本(Notepad)中。
注意:(Note:) 请(Please)注意,在使用此配置时,您始终需要在要连接到站点的URL上附加(URL)TCP/IP端口号。例如,要在浏览器上访问Apache服务器,您需要输入: localhost:121/dashboard而不是localhost/dashboard。
正确执行上述步骤后,XAMPP中(XAMPP)Apache的启动问题将得到修复。
3]停止万维网发布服务(Stop World Wide Web Publishing Service)
另一种方法是,您需要停止万维网发布服务(World Wide Web Publishing Service)并更改其设置,以便只能手动启动该服务。那么,让我们开始吧:
要停止万维网发布服务(World Wide Web Publishing Service),您首先需要在 Windows 10 PC 上打开 Windows 服务管理器。(open Windows Services Manager)
在“服务”屏幕上,在“(Services)名称(Name)”列下搜索“万维网发布服务(World Wide Web Publishing Service )”选项。
找到后,双击它以打开属性窗口。
在属性窗口中,常规(General)选项卡默认打开。
在 General 选项卡上,找到Startup Type并将其切换为Manual。这将允许您在需要时手动启动服务。
继续前进,停止服务运行状态,然后单击Apply > OK按钮。
现在,打开XAMPP 控制面板(XAMPP Control Panel)并单击开始(Start)按钮以运行 Apache 服务器。
就是这样。我希望本指南能帮助您解决 XAMPP 控制面板上 Apache 服务的启动问题。(That’s it. I hope this guide would help you to fix the starting problem of the Apache service on the XAMPP Control Panel.)
Apache is not starting from XAMPP Control Panel in Windows 11/10
Αfter installing the XAMPP Control Panel on Windows, many users reported encountering an error while starting Apache. This issue commonly occurs when a process like World Wide Publishing Service keeps running in the 80 port of your device. Due to this, the Windows 11/10 operating system does not allow the Apache server to execute, and that way it causes the error.
5:38:38 PM [Apache] Error: Apache shutdown unexpectedly.
5:38:38 PM [Apache] This may be due to a blocked port, missing dependencies,
5:38:38 PM [Apache] improper privileges, a crash, or a shutdown by another method.
5:38:38 PM [Apache] Press the Logs button to view error logs and check
5:38:38 PM [Apache] the Windows Event Viewer for more clues
5:38:38 PM [Apache] If you need more help, copy and post this
5:38:38 PM [Apache] entire log window on the forums
Actually, Port 80 on a computer also used to be the default TCP/IP port that Apaches module uses on XAMPP. And since two different applications can’t use the same networking port, therefore you must have to stop it before starting the XAMPP’s Apache server. If you’re also experiencing this issue on your device, there are a few easy workarounds that I have mentioned in this guide. So, let’s get started.
Apache not starting from XAMPP Control Panel
Clearing the World Wide Web Publishing Service would be the best approach to make start the Apache again. However, you can also get it by changing the TCP/IP port number or by stopping the service if needed. So, to fix Apache not starting on XAMPP Control Panel, follow these all possible methods:
- Clear World Wide Web Services
- Change the default Apache TCP/IP port
- Stop World Wide Web Publishing Service
Let us see them in detail.
1] Clear World Wide Web Services
In order to solve the starting problem of the Apache service, you must have to clear the world Wide Web Services from your device. But before begin, ensure that you don’t have any app relying on this service.
If everything seems to be okay, open the Control Panel on your Windows system.
Once it opens, select to view the Control Panel in either Large icons or Small icons option, so that you could see all the Control Panel items.
From the available items, select Programs and Features option.
In the left sidebar, there is a link named Turn Windows features on or off, click on it.
In the Windows Features dialog box, expand the Internet Information Services field.
Now, clear the checkbox regarding World Wide Web Services and then click on the OK button to save the changes.
Once you complete the above steps, reboot your device. After that, open the XAMPP Control Panel and click on the Start button on Apache. It should now run in port 80 on your computer.
2] Change the default Apache TCP/IP port
If due to any reason, the above method workaround doesn’t work for you, you need to configure Apache to execute on a different TCP/IP port. So, follow these suggestions:
Open the XAMPP Control Panel on your Windows device.
Click on the Config button of the Apache module.
Select Apache (httpd.conf) option from the list of the pop-up menu.
On the following notepad page, you need to find Listen 80.
To make the search easy, press the Ctrl+F shortcut key. In the pop-up menu, type what you want to search. Mark Wrap around checkbox, leave Match case unchecked, and then click on the Find Next button.
Once you find the respective line, change the port number with any arbitrary number of your choice.
For example, you can try port 121. Then the corresponding result for TCP/IP port number would be something like – Listen 121.
Press Ctrl+S shortcut key to save the changes in the Notepad.
Note: Please note that while using this configuration, you always need to append the TCP/IP port number on the URL you want to connect to your site. For instance, to access the Apache server on your browser, you will need to enter: localhost:121/dashboard rather than localhost/dashboard.
After performing the above steps properly, the starting problem of the Apache in XAMPP would be fixed.
3] Stop World Wide Web Publishing Service
In an alternative way, you need to stop the World Wide Web Publishing Service and change its settings so that the service can only be started manually. So, let’s get started:
In order to stop the World Wide Web Publishing Service, you first need to open Windows Services Manager on your Windows 10 PC.
On the Services screen, search for the World Wide Web Publishing Service option under the Name column.
Once you find, double-click on it to open the properties window.
In the properties window, the General tab opens by default.
On the General tab, locate Startup Type and switch it to Manual. This will let you start the service manually when it is required.
Moving ahead, stop the service running status and click on Apply > OK button.
Now, open the XAMPP Control Panel and click on the Start button to run the Apache server.
That’s it. I hope this guide would help you to fix the starting problem of the Apache service on the XAMPP Control Panel.