logo头像
Snippet 博客主题

Mac搭建PHP开发环境

本文于2373天之前发表,文中内容可能已经过时。

Mac搭建PHP开发环境(mamp+phpstorm+xdebug)

OS版本


Paste_Image.png

一.首先下载搭建环境所需要的软件

1.phpstorm 密码: jebr
2.mamp pro密码: mhia
3.chrome
4.JetBrains IDE Support(chrome插件)

二.安装成功之后配置mamp

新建一个server目录

Paste_Image.png
默认会生成以下两个文件

Paste_Image.png

mamp是自带xdebug的,因此我们不需要brew来安装xdebug,直接启用

Paste_Image.png
启动serve之后默认会跳转mamp的信息界面

Paste_Image.png
点击菜单栏的phpinfo,边可以看到php的相关配置

Paste_Image.png然后再

Paste_Image.png

三.配置phpstorm

删掉index.php的所有代码输入一段测试代码

Paste_Image.png
配置项目的运行环境
Paste_Image.png
选择php位置

Paste_Image.png
然后apply ok
修改端口

Paste_Image.png
配置DBCpProxy
Paste_Image.png

Paste_Image.png

Paste_Image.png

四.chromeJetBrains IDE Support Chrome插件并启用

五.打断点调试

Paste_Image.png

上一篇