phpstorm - xdebug

重点说明!!

phpstorm如果出现一切配置都成功,但是watches没有任何的变量,任何调试数据信息,则说明 php版本与phpstorm不兼容!因此需要更换phpstorm版本

php.ini配置xdebug

[Xdebug]
zend_extension=D:/soft/phpstudy_pro/Extensions/php/php7.2.9nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=D:/soft/phpstudy_pro/Extensions/php_log/php7.2.9nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=D:/soft/phpstudy_pro/Extensions/php_log/php7.2.9nts.xdebug.profiler
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9666
xdebug.remote_handler=dbgp

 

phpstorm-->file-->setting

phpstorm:  Run->Edit Configurations

1. 启动phpstorm的server 监听 上面配置的9666的端口

2. 点击2 给某个代码打断点

3. 打开浏览器,访问这个代码的url路径 并带一个参数 ?XDEBUG_SESSION_START=15934

4. php的xdebug 得到?XDEBUG_SESSION_START=15934这个标识知道您在调试,然后把调试信息 发送到 9666端口

5. phpstorm 得到调试信息,在下面显示相关调试信息

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章