Mac下PHP开环境搭建
Mac下PHP开发环境搭建
MacOS
MAMP PRO
PhpStorm
MAMP设置
1.设置Hosts
2.设置Ports
3.设置MySQL
4.设置PHP
在PHP设置的Log errors的选项中要勾上"to screen"选项,这样可以在浏览器中输出错误信息,方便开发调试
PhpStorm
1.设置Server
PhpStorm→Preferences…→Languages&Frameworks→PHP→Servers
2.设置项目部署(Deployment)
PhpStorm→Preferences…→Build, Execution, Deployment→Deployment
PS:此项目如果配置不正常,则会出现PHP页面获取不到POST数据的问题。
3.设置PhpStorm的PHP解释器版本(PHP解释器由MAMP提供)
PhpStorm→Preferences…→Languages&Frameworks→PHP
4.设置PHP Remote Debug(作为Run的环境)
5.配置选用的PHP解释器对应的php.ini文件
在设置PhpStorm的PHP解释器版本中配置CLI Interpreter时有要求点击Open In Editor,于是出现如下配置文件,进行配置