由于最新版本的wampserver集成了xdebug插件,不需要额外安装(D:/wamp64/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11-x86_64.dll
)
第一步:修改php.ini
左键点击wamp图标,选择PHP,再点击php.ini,直接这样修改(防止修改错地方)
; XDEBUG Extension
[xdebug]
; xdebug插件存放位置
zend_extension ="D:/wamp64/bin/php/php5.6.25/zend_ext/php_xdebug-2.4.1-5.6-vc11-x86_64.dll"
; 是否开启远程调试
xdebug.remote_enable = on
; 是否开启调试内容
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="D:/wamp64/tmp"
xdebug.show_local_vars=1
; 这里是调试器的关键字 在Chrome以及FireFox中插件配置的时候要用到
xdebug.idekey = PHPSTORM
; 调试插件dbgp
xdebug.remote_handler = dbgp
; 允许调试的客户端IP
xdebug.remote_host = 127.0.0.3
; 远程调试的端口(默认 9000)
xdebug.remote_port = 9000
可以通过 phpinfo() 查看配置的xdebug
第二步:配置PHPSTORM
选择PHPSTORM的PHP版本
在这里点击PHP executable最后面的三个点选择项目所用到的PHP版本 .
添加服务器(我的理解就是项目的URL)
一般默认是localhost,我这里直接用的是需要调试的项目的127.0.0.3
DEBUG配置
Debug port一般是9000,占用了可以选择(9001,9002之类的,此外还需要到php.ini里面修改)
DBGp Proxy设置
第三步:Firefox配置
到火狐组件扩展中心下载The easiest Xdebug
调试
打断点,在断点处在页面上运行