我刚刚重新安装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

我怎么解决这个问题?


当前回答

首先确保你的\xampp文件夹在根目录下!这很重要,因为路径是相对的。 然后确保以管理员权限运行xampp_control.exe。 然后更改下面的文件,以避免阻塞端口80的问题。

在\xampp\xampp-control.ini中应该这样设置:

[ServicePorts]
Apache=8080
ApacheSSL=4433

找到\xampp\apache\conf\httpd.conf并设置:

Listen 8080

ServerName localhost:8080

找到\xampp\apache\conf\extra\httpd-ssl.conf并设置:

Listen 4433

<VirtualHost _default_:4433>

ServerName www.example.com:4433

然后结束所有服务,以admin权限重新启动xampp-control.exe。它应该运行!

其他回答

首先确保你的\xampp文件夹在根目录下!这很重要,因为路径是相对的。 然后确保以管理员权限运行xampp_control.exe。 然后更改下面的文件,以避免阻塞端口80的问题。

在\xampp\xampp-control.ini中应该这样设置:

[ServicePorts]
Apache=8080
ApacheSSL=4433

找到\xampp\apache\conf\httpd.conf并设置:

Listen 8080

ServerName localhost:8080

找到\xampp\apache\conf\extra\httpd-ssl.conf并设置:

Listen 4433

<VirtualHost _default_:4433>

ServerName www.example.com:4433

然后结束所有服务,以admin权限重新启动xampp-control.exe。它应该运行!

我刚刚在我的xampp v3.2.2 [win 10 pro x64]上遇到了这个错误,

我首先尝试在管理cmd中运行“net stop http”命令,但它没有解决问题,所以我继续尝试“netstat -abno”命令,我发现ssl端口(443)正在被vmware使用。

因此,我的建议是,不要只寻找阻塞端口80的原因,还要寻找使用端口443的潜在程序。因为我真的不喜欢把我的默认端口号改为8081和4433。

这就是你解决这个问题的方法…

首先输入以下命令

停止HTTP

然后尝试启动apache,如果它仍然不工作。输入以下命令

Netstat -ABNO

你肯定会遇到麻烦的应用,它会占用你宝贵的移植端口。

复制pid,然后使用以下命令

taskkill /f /pid pid

这里的PID是你复制的PID。

希望这能帮助到一些人。

我的问题是在httpd.conf中的DocumentRoot和<Directory>条目指向不存在的文件夹。

例如,'原始' httpd.conf有以下条目:

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

如果您已经安装在C:\xampp中,那么您需要更改这些条目以匹配。

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

在XAMPP控制面板V3.2.1中,单击右上角的“NetStat”按钮。确保端口80没有被任何其他程序使用。然后点击它下面的“Shell”。在shell提示符中发出这个命令;

Apache_Start.bat

或者输入“ap”,然后按tab键两次,这将类似地生成上述命令。 您将看到Apache失败的确切错误。这很可能是虚拟主机配置问题或其他问题。它将显示发生错误的行号。只需要修复这个错误。注意,在RootDocument中,尾随的\也可能是错误的来源。删除任何拖尾""。

同样的错误。原来我加载了错误版本的zend xdebug扩展。xdebug向导说使用TS(线程安全)版本(即没有- nts -),但显然我下载了错误的非线程安全版本。即使我在php.ini文件中有正确的路径和文件名,我仍然得到错误。当我下载不同的版本,并再次更新php.ini时,一切都运行正常。

php_xdebug-2.7.0-7.3-vc15-nt -x86_64.dll给了我一个错误,但php_xdebug-2.7.0-7.3-vc15-x86_64.dll没有错误