L00-PHP难点

PHP难点

Apache

错误:No installed service named "Apache2.4"

1、问题:输入 httpd -k stop 时,提示No installed service named "Apache2.4" 错误

2、解决步骤

  • cmd窗口,进入Apache2的bin目录(比如我的bin路径为E:\Apache24\bin)

  • 运行httpd.exe -k install -n "Apache2.4" 安装Apache到Windows服务中

    记得先修改文件httpd.conf
    Define SRVROOT "E:/Apache24" ServerRoot "${SRVROOT}"

  • 成功提示

运行结果如上图所示,则为成功

  • 之后可以把apache的bin路径配置到环境变量的Path内,以后就可以直接运行httpd -k start打开apache服务器

  • Apache的相关命令

    1.httpd -k start 启动apache服务
    2.httpd -k stop/shutdown 关闭apache服务
    3.httpd -k restart 重启apache服务
    4.sc delete Apache2.4 删除名为Apache2.4的apache服务
    

posted @ 2021-09-01 23:41  PikachuTT  阅读(60)  评论(0编辑  收藏  举报