xampp不工作,当我尝试启动服务器时出现错误

des4xlb0  于 2021-06-24  发布在  Mysql
关注(0)|答案(2)|浏览(301)
Error: Apache shutdown unexpectedly.
11:58:07  [Apache]  This may be due to a blocked port, missing dependencies, 
11:58:07  [Apache]  improper privileges, a crash, or a shutdown by another method.
11:58:07  [Apache]  Press the Logs button to view error logs and check
11:58:07  [Apache]  the Windows Event Viewer for more clues
11:58:07  [Apache]  If you need more help, copy and post this
11:58:07  [Apache]  entire log window on the forums

我无法启动服务器,上面的错误出现在我尝试启动时

eh57zj3b

eh57zj3b1#

打开xampp控制面板并选择apache下的config。选择httpd.conf并找到以下行。


# Listen: Allows you to bind Apache to specific IP addresses and/or

# ports, instead of the default. See also the <VirtualHost>

# directive.

# 

# Change this to Listen on specific IP addresses as shown below to

# prevent Apache from glomming onto all bound IP addresses.

# 

# Listen 12.34.56.78:80

Listen**xx**

你看到xx把它改成8080,如果它现在的状态是81。端口81通常由一些应用程序使用,因此我倾向于在默认情况下总是更改为8080,但是您的网络可能不同。你可以用 netstat 查看您可以使用哪些端口。
完全重新启动xampp,因为apache非常繁琐,然后再次尝试启动apache。

kdfy810k

kdfy810k2#

默认情况下,apache使用80端口,如果该端口经常被其他程序占用,则可能会导致此问题。解决此问题的步骤如下:
第1步-在xampp控制面板的apache下,单击config按钮,然后选择apache(httpd.conf)。
在httpd.conf文件中,不知何故我找到了一行,上面写着:
听着80
把80换成你想要的任何号码/端口。在我的场景中,我使用的是8080端口。
听着8080
还是从httpd.conf文件中,我发现了另一行:
服务器名localhost:80
把80换成8080。
服务器名localhost:8080
更改完成后保存httpd.conf文件
第2步-在xampp控制面板的apache下,再次单击config按钮,但这次选择apache(httpd ssl.conf)。在httpd-ssl.conf文件中,找到一行
听着443
把443换成你想要的任何号码/端口。我将使用4433作为新的端口号。
听着,4433
仍然可以从httpd-ssl.conf文件中找到另一行
服务器名localhost:443
把443换成4433。
服务器名localhost:4433
更改完成后保存httpd-ssl.conf文件
p、 s:重新启动apache服务。

相关问题