【问题标题】:Unable to start Apache module in xamp server无法在 xampp 服务器中启动 Apache 模块
【发布时间】:2017-09-03 02:43:01
【问题描述】:

我最近第一次安装了xamp服务器,想在本地服务器上运行一个php网站。当我在 xamp 服务器中启动 Apache 模块时,它显示以下错误,但是 MySQL 启动并运行良好:

9:04:58 PM  [Apache]    Attempting to start Apache app...
9:04:58 PM  [Apache]    Status change detected: running
9:04:58 PM  [Apache]    Status change detected: stopped
9:04:58 PM  [Apache]    Error: Apache shutdown unexpectedly.
9:04:58 PM  [Apache]    This may be due to a blocked port, missing dependencies, 
9:04:58 PM  [Apache]    improper privileges, a crash, or a shutdown by another method.
9:04:58 PM  [Apache]    Press the Logs button to view error logs and check
9:04:58 PM  [Apache]    the Windows Event Viewer for more clues
9:04:58 PM  [Apache]    If you need more help, copy and post this
9:04:58 PM  [Apache]    entire log window on the forums

我这样做是为了我的软件测试任务。我必须在本地服务器上测试一个网站,为此我安装了 xamp 服务器。有人可以帮忙吗?

【问题讨论】:

  • 您是否按下了“日志”按钮?日志文件说什么?

标签: php mysql apache xampp


【解决方案1】:

在某些情况下,您的网络管理员或 ISP 会阻止某些端口(尽管我不建议将 Xampp 作为可公开访问的服务器运行)。

端口 80 被 Skype 等其他一些应用程序使用。当您想同时访问 Apache 和这些应用程序时,可能会出现一些冲突,您可以选择更改 Apache 服务器的端口号

如果您的 Apache 服务器不工作,则表明其他一些应用程序正在使用端口 80

让我们手动完成。 第 1 步:对于这个过程,首先打开位于 xampp\apache\conf\

的 httpd.conf 文件

在我的系统中,我的 xampp 安装在 C 盘,所以我的路径是 c:\xampp\apache\conf
您的可能与此不同 所以现在使用文本编辑器或程序员的编辑器打开 httpd.conf 文件(我使用的是记事本++) 现在找到说 Listen 80 的行。它是第 47 行,或者按 contol+f 并键入 80 然后它会自动将 courser 移动到这里然后将 80 更改为您自己的端口,这里我使用的是 3388。 之后按 control+s 保存文件。 保存成功后重启Apache服务器你的端口号就成功修改了

【讨论】:

    【解决方案2】:

    这个问题可能有很多可能的答案。最常见的是另一个在 80 端口上运行的程序。我遇到了同样的问题,然后我发现我的 Vagrant 盒子在 80 端口上运行。

    如果您的计算机上安装了 Skype,请将您的 apache 端口更改为其他端口。

    为此,请转到 xampp/apache/conf/httpd.conf 并在 httpd.conf 中更改以下行:

    ServerName localhost:80
    

    ServerName localhost:81
    

    此外,如果它不起作用,请更改以下行:

         Listen 80
         to 
         Listen 81
    

    【讨论】:

    • 你说的文件我已经打开了。你能告诉我把你提到的那条线放在哪里吗?正如我检查过的,没有文件说明 serverName localhost: something
    • 你使用的是什么操作系统?
    • 使用windows 8.1
    • 打开你的 XAMPP 文件夹,进入 /etc/httpd.conf。然后打开该文件并更改我之前告诉您的行。似乎他们已经改变了他们的界面。让我知道它是否修复了
    【解决方案3】:

    有时,由于您计算机上的其他软件使用相同的端口而发生此错误,因此您必须更改端口号或从其他软件(如虚拟盒等)禁用相同的端口号

    【讨论】:

    • 嗨,欢迎来到 stackoverflow。请提供一个最小、完整和可重现的代码示例。没有代码,任何人都无能为力。
    猜你喜欢
    • 2015-07-03
    • 2018-06-18
    • 2016-04-19
    • 2016-01-08
    • 1970-01-01
    • 2016-03-22
    • 1970-01-01
    • 2016-10-19
    • 2020-09-27
    相关资源
    最近更新 更多