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

我怎么解决这个问题?


当前回答

当我使用命令发现没有进程使用端口80时

netstat -abno | find ":80"

使用端口80的任何进程都没有问题。

然后我运行命令(在cmd中)

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

它在httpd-vhosts.conf文件中的虚拟主机配置中显示了一些错误,该文件最近由我编辑,用于在Eclipse IDE中的WordPress PHP环境中安装。所以我删除了这些行,Apache开始得很好。

其他回答

试试下面的方法,上面的方法都不能解决我的问题

选择“以管理员身份运行”

然后点击Apache旁边的左边大框

并选择卸载Apache

我不知道为什么这样做,但它直接解决了我的问题!

注意,无论何时更改默认端口,浏览器都不会知道。80和443似乎在某种程度上是标准的,例如,如果您将80更改为8080,那么您将不得不以这种方式访问您的网站:

localhost: 8080 / path_to_your_website.php

如果更改端口不能解决上述建议的问题,并且如果您可能玩弄了文件目录结构(例如,在安装后更改文件夹的名称,就像我所做的那样),那么您可以尝试这样做,

打开XAMPP控制面板,点击Apache的“配置” 选择Apache (httpd.conf) 在打开的编辑器中,按CTRL+H找到旧文件夹名的所有实例,并用新文件夹名替换它。

例如,在我的例子中,我已经将XAMPP的主安装文件夹名称从Xam更改为XAMPP

在编辑器中修改如下:

Define SRVROOT "G:/Xam/apache"
ServerRoot "G:/Xam/apache"
DocumentRoot "G:/Xam/htdocs"
<Directory "G:/Xam/htdocs">

To

Define SRVROOT "G:/Xampp/apache"
ServerRoot "G:/Xampp/apache"
DocumentRoot "G:/Xampps/htdocs"
<Directory "G:/Xampps/htdocs">

在编辑器中还有许多其他这样的实例,只需找到并替换它们中的每一个。

对Apache (httpd-ssl.conf)也执行同样的操作。

同样的错误。原来我加载了错误版本的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没有错误

我的例子很简单。

我在我的以太网端口上设置了一个本地IP地址。

然后出现这个错误。结果我并没有连接 将电缆连接到它,因此IP不会解析为Apache中的IP集。

解决方案是将电缆连接到交换机或路由器。然后可以启动Apache。