2014-10-07 126 views
0

嗨我安装在虚拟机器上运行的Windows 7上的xampp我的apache昨天工作正常,但突然它今天停止工作。我查看错误日志,但它只显示昨天的日志,今天的日志没有得到更新,我找不到确切的错误。xampp apache 2.4.9突然停止工作

但是,当我开始在XAMPP控制面板中的阿帕奇它显示了以下错误

3:18:48 PM [Apache] Error: Apache shutdown unexpectedly. 
3:18:48 PM [Apache] This may be due to a blocked port, missing dependencies, 
3:18:48 PM [Apache] improper privileges, a crash, or a shutdown by another method. 
3:18:48 PM [Apache] Press the Logs button to view error logs and check 
3:18:48 PM [Apache] the Windows Event Viewer for more clues 
3:18:48 PM [Apache] If you need more help, copy and post this 
3:18:48 PM [Apache] entire log window on the forums 

我试图改变港口,但得到了同样的错误不知道如何着手,请帮我解决这个issue.Thanks提前。

注意:这个问题已经被问及,我试过这些解决方案,但同样的错误存在。

+0

阅读Windows事件查看器,可能窗口由于某种原因停止了apache进程 – 2014-10-07 11:58:01

回答

2

嗨,我找到了答案自己通过在cmd中挖掘出的问题,我跑的命令

netstat -a 

它会显示在我的情况下,端口80所使用的端口没有被使用,因此误差是不是因为端口问题

如果问题不是繁忙的端口,您还可以尝试以下操作:在XAMPP配置面板中选择“显示调试信息”。你会发现这个选项在配置面板启用此选项,并单击保存它将显示正在执行的文件,就像启动Apache时,你会看到像“执行”c:\ xampp \ apache \ bin \ httpd.exe “。如果你在cmd提示符下运行相同的命令,它会清楚地显示错误文件名和行号

所有你需要做的就是找到相应的文件在代码中挖并解决它。你的问题将来解决。

在我的情况我在虚拟主机配置错误更改文件/xampp/apache/conf/extra/httpd-vhost.conf线27从

##<VirtualHost *:80> 
    ##ServerAdmin [email protected] 
    ##DocumentRoot "C:/xampp/htdocs" 
    ##ServerName www.example.com 
    ##ServerAlias www.dummy-host.example.com 
    ##ErrorLog "logs/dummy-host.example.com-error.log" 
    ##CustomLog "logs/dummy-host.example.com-access.log" common 
##</VirtualHost> 
更改为

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "C:/xampp/htdocs/snipe-it/public" 
    ServerName localhost 
    ##ServerAlias www.dummy-host.example.com 
    ##ErrorLog "logs/dummy-host.example.com-error.log" 
    ##CustomLog "logs/dummy-host.example.com-access.log" common 
</VirtualHost> 

并重新启动我的Apache我的问题得到解决。