mac下phpstorm配置xdebug
准备工作
- 你有phpstrom,同时安装了homebrew
开始工作
习惯了用echo和var_dump(),但是每一次都需要去查找是哪个部分出了错误,这样你就要去写好多的echo或者var_dump去定位到底是哪里出了错误,同时,我们用的是phpstorm IDE啊这样的编辑器必要要好好利用下了
1、安装xdebug
|
|
2、配置xdebug
因为是用brew安装的所以这个文件是在 /usr/local/etc/php/5.6/conf.d目录中ext-xdebug.ini
|
|
3、配置phpstorm
- 进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9001,其他默认
- 进入File>Settings>PHP>Servers,host 填localhost,port 填80
- 进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 PHPSTORM,host 填localhost,port 填80
4、下面就可以进行测试了哦,在phpstorm的右上角有个debug的配置,然后填写你要启动的页面就可以了
总结
good luck