1.由于mac下自带apache和php 直接打开命令行便可php
首先切换到root用户 sudo -i
apache
接着查看80端口是否被暂用 lsof
服务器
查看apache 版本 httpd -v网站
开启apache apachectl startthis
重启apache apachectl restartspa
关闭apache apachectl stop
命令行
运行 127.0.0.1,显示it works表示apache开启成功
3d
command+shift+G 进入路径/etc/apache2 开启apache配置文件httpd.conf 开启php模块,
rest
编写test.php代码 test.php存放路径 /Library/WebServer/Documents 即Apache的网站服务器根目录在/Library/WebServer/Documents
orm
须要重启apache后再 运行127.0.0.1/test.php 显示这个页面表示运行成功