刚换了工作,今天第一天报到,熟悉环境,配置开发环境。给我分配的工作电脑上已经安装有XAMPP,发现Apache启动不了,XAMPP控制面板上提示:
XML/HTML代码
- 11:27:36 [Apache] Error: Apache shutdown unexpectedly.
- 11:27:36 [Apache] This may be due to a blocked port, missing dependencies,
- 11:27:36 [Apache] improper privileges, a crash, or a shutdown by another method.
- 11:27:36 [Apache] Press the Logs button to view error logs and check
- 11:27:36 [Apache] the Windows Event Viewer for more clues
- 11:27:36 [Apache] If you need more help, copy and post this
- 11:27:36 [Apache] entire log window on the forums
看这提示信息,应该是端口被占用,用DOS命令netstat -ano查了端口,也没发现有被占用的。用命令行模式到D:xamppapachein目录下运行httpd,提示:
XML/HTML代码
- AH00526: Syntax error on line 238 of D:/xampp/apache/conf/httpd.conf:
- DocumentRoot must be a directory
打开配置文件,发现DocumentRoot设置的目录已经不存在了,估计是以前用这台电脑的同事清理了,改为一个存在的目录,再重启Apache,成功了。