Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php xampp不工作,尝试启动服务器时出现错误_Php_Html_Mysql_Xampp - Fatal编程技术网

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

Php xampp不工作,尝试启动服务器时出现错误,php,html,mysql,xampp,Php,Html,Mysql,Xampp,我无法启动服务器,当我尝试打开XAMPP控制面板并在Apache下选择Config时,会出现上述错误。选择httpd.conf并找到以下行 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 b

我无法启动服务器,当我尝试打开XAMPP控制面板并在Apache下选择Config时,会出现上述错误。选择httpd.conf并找到以下行

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
#Listen:允许您将Apache绑定到特定的IP地址和/或
#端口,而不是默认端口。另见
#指令。
#
#将此更改为侦听特定IP地址,如下所示
#防止Apache欺骗所有绑定的IP地址。
#
#听12.34.56.78:80
听**xx**
在您看到的xx中,如果当前状态为81,则将其更改为类似8080。端口81通常由一些应用程序使用,因此我倾向于在默认情况下始终更改为8080,但您的网络可能不同。您可以使用
netstat
查看哪些端口可用


完全重新启动XAMPP,因为Apache非常麻烦,然后再次尝试启动Apache。

如果端口被其他程序占用,Apache默认使用80端口,可能会导致此问题。解决此问题的以下步骤:

步骤1-从XAMPP控制面板的Apache下,单击Config按钮,然后选择Apache(httpd.conf)

在httpd.conf文件中,不知怎的,我找到了一行,上面写着:

听80

并将80换成您想要的任何号码/端口。在我的场景中,我使用的是8080端口

听8080

仍然是从httpd.conf文件中,我发现了另一行内容:

ServerName本地主机:80

把80换成8080

ServerName本地主机:8080

完成更改后保存httpd.conf文件

步骤2-从XAMPP控制面板的Apache下,再次单击Config按钮,但这次选择Apache(httpd ssl.conf)。在httpd-ssl.conf文件中,找到一行

听我说

并将443换成您想要的任何号码/端口。我将使用4433作为新端口号

听着,4433

仍然可以从httpd-ssl.conf文件中找到另一行

ServerName本地主机:443

把443换成4433

ServerName本地主机:4433

完成更改后保存httpd-ssl.conf文件


p.S:重新启动Apache服务。

您是否尝试过在配置文件中编辑Apache侦听的端口?尝试将其设置为8080而不是80。有关更多详细信息->
# 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**