且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WAMP/Xamp Apache服务器无法启动

更新时间:2021-09-03 23:20:48

记录下来,这帮助我解决了问题:

For the record, this helped me getting it solved:

  • 检查是否可以通过程序而不是服务来启动apache,而是通过命令提示符启动! httpdhttpd -e debug表示所有可能的错误&调试消息 如果无法启动,则可能会告诉您原因(例如php或apache配置错误)
  • 如果仍然不能正常运行,请通过命令提示符安装并作为服务*运行,以查看是否还有其他问题.
    httpd -k installhttpd -k start
    检查命令提示符下的输出,error.log和Windows System Event Viewer(Windows日志/系统)
  • Check if you can start apache as program, not service, but via command prompt! httpd or httpd -e debug for all possible error & debug messages If it won't start, it will probably tell you the reason (e.g. php or apache configuration error)
  • If still not OK then install and run it as a service* via command prompt to see if there is anything else wrong.
    httpd -k install and httpd -k start
    Check output at command prompt, error.log and Windows System Event Viewer (Windows Logs/System)

对我来说,这使我知道我的httpd.conf中有错误. 一段时间后,我发现它与别名目录有关,可能与权限有关.更改文件夹的权限无济于事(可能是BC.我不知道默认服务使用的用户),但是更改服务以我的用户(即admin)身份登录确实可以.

For me this learned me that I had errors in my httpd.conf. After a while I discovered it had something to do with my alias directory, probably permissions. Changing permissions on folder didn't help much (probably bc. I don't know which User the default service uses), but changing service to log on as my user (which is admin) did work.

* 如果您拥有xampp或wamp,则将其删除,否则您将有两次输入.