PHP+apache 安装 配置(windows)(进行中)

来源:互联网 发布:linux sys gpio 编辑:程序博客网 时间:2024/06/03 11:49

配置主机名:

找到文件 C:\WINDOWS\system32\drivers\etc\hosts, 增加主机名配置

    127.0.0.1       localhost    127.0.0.1       water.mantis.net

apache for windows地址: http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/

.If PHP is used with IIS then choose PHP 5.3 VC9 Non Thread Safe or PHP 5.2 VC6 Non Thread Safe;
.If PHP is used with IIS7 or greater and PHP 5.3+, then the VC9 binaries of PHP should be used.
.If PHP is used with Apache 1 or Apache 2 then choose PHP 5.3 VC6 or PHP 5.2 VC6.

  • 缺省配置文件:apache_installed_dir/conf/httpd.conf

配置监听端口

 Listen 80 Listen 8000 
 Listen 192.0.2.1:80 Listen 192.0.2.5:8000      
安装windows service命令
  • 安装和卸载缺省名字的service(Apache2.2).

httpd.exe -k install

httpd.exe -k uninstall 

  • 安装指定名字的service
httpd.exe -k install -n "MyServiceName"

httpd.exe -k uninstall -n "MyServiceName"

  • 安装指定名字,指定配置文件的service

httpd.exe -k install -n "MyServiceName" -f "c:\files\my.conf" 

  • 测试服务的配置文件

httpd.exe -n "MyServiceName" -t

  • net start [service] 例如开启本地的

NET START Apache2.2

NET STOP Apache2.2

  • Apache启动命令

httpd.exe -k start

httpd.exe -k start -n "MyServiceName"

httpd.exe -k restart -n "MyServiceName"

httpd.exe -k stop -n "MyServiceName"

httpd.exe -k shutdown -n "MyServiceName"

查看日志:Start - Settings - Control Panel - Administrative Tools - Event Viewer.

原创粉丝点击