phpstrom+xdebug+Xdebug helper 调试php

第一步,php.ini打开xdebug扩展php

xdebug.remote_enable=on
; 此地址为IDE所在IP
xdebug.remote_host=127.0.0.1
xdebug.remote_port=19000
; 能够是任意Key,这里设定为PHPSTORM
xdebug.idekey="PhpStorm"

第二步设置phpstromchrome

File>Settings,PHP | Debug,在Xdebug标签框内,根据服务器端的Xdebug端口,配置Debug port。浏览器

第三步服务器

在google浏览器安装chrome扩展 Xdebug helper框架

进入 Xdebug hepler 的配置选项中,选择 IDE key 为 PHPStormide

点击地址栏的小虫子把扩展调整为 debug 模式工具

第四步google

依次打开 PHPStorm 中的 Run>Start Listening for PHP Debug Connectionsspa

 

另外针对框架/项目的调试方式须要在以上配置基础上,再进行一些配置:debug

1.点击菜单里的 Run – Edit Configurations选项。

2.点击 “添加” 按钮,选择 PHP Web Application,并在右侧输入配置名称,选择咱们刚刚添加的 Server,Start URL 中填写调试可能所需的查询字符串,选择好默认浏览器,最后点击 Apply 和 OK,确认配置。

在程序中设置好断点;在工具栏中,选择好要调试的应用;点击 Start Listening for PHP Debug Connections 按钮,即那个红色的电话按钮,让其变成绿色,即开始监听 PHP Debug 链接;因而,终于能够开始了。点击上图中的 Debug 按钮,或者从菜单中选择 Run – Debug,你就开始了 Debug 之旅…