1 启动apache 默认是启动的
sudo apachectl start
2 查看版本
sudo apachectl -v
3 启用php
打开文件 sudo vi /etc/apache2/httpd.conf
找到 #LoadModule php5_module libexec/apache2/libphp5.so 去掉 #
4 修改DocumentRoot
1) 找到 DocumentRoot "/Library/WebServer/Documents"
修改 DocumentRoot "[自动的路径]"
2) 找到 <Directory "/Library/WebServer/Documents">
修改为<Directory "[上面的路径]">
重启apache sudo apachectl restart