说实话我试过xdebug,说实话我一次也没成功过,所以我觉得我经验还不够
简单的方法:
前期工作需要安装xdebug
在php.ini的末尾
[XDebug]
; 这是xdebug的dll,需要下载到官方网站。 必须区分自己的PHP是线程安全的还是不是线程安全的。 否则,版本不同,无法安装
Zend _ extension=' e :PHP-5.6.38-win32-vc11-x64ext _ PHP _ xdebug-2.4.0-5.6-vc11-x86
; 是否允许调用Xdebug跟踪函数。 跟踪信息保存为文件,默认值为0
xdebug.auto_trace=1
; 解决ip变化问题
xdebug.remote_connect_back=1
; 是否允许Xdebug跟踪函数的参数。 默认值为0
xdebug.collect_params=1
; Xdebug跟踪函数是否允许返回值。 默认值为0
xdebug.collect_return=1
; 函数调用跟踪信息输出文件目录。 默认值为/tmp
xdebug.trace _ output _ dir=' e :PHPPHP tutorialtmpxdebug '
; 配置文件的保存位置。 默认值为/tmp
xdebug.profiler _ output _ dir=' e :PHPPHP tutorialtmpxdebug '
; 打开xdebug的profiler并将其另存为文件。 此设置不能由ini_set ()函数设置。 默认值为0
xdebug.profiler_enable=1
; 配置文件的命名约定。 默认值为cachegrind.out.%p
xdebug.profiler _ output _ name=' cache grind.out.% t.% p '
xdebug.remote_enable=1
xdebug.remote_autostart=1
; 一种用于zend studio远程调试的APP应用层通信协议
xdebug.remote_handler='dbgp '
xdebug.idekey=PHPSTORM
; 本地IP地址
xdebug.remote _ host=' 192.168.43.212 '
xdebug.remote_port=8080
xdebug.show_local_vars=1
xdebug.show_exception_trace=1
xdebug.collect_includes=1
xdebug.remote _ log=' e :PHPPHP tutorialtmpxdebug.log '
具有firefox浏览器,并将xdebug helper添加到浏览器的“附加模块”
Idea的Run下的编辑配置如下构成
选择要调试的php文件,然后选择安装了xdebug helper浏览器(在本例中为firefox )
3 .打开右上角的小电话,在需要调试的地方放入断点,然后点击右上角的绿色三角按钮,可以调试断点