phpstom 配置xdebug

xdebug 原理 :

php 服务器为 client , phpstom 为调试服务器

获取php对应的xdebug 版本:

https://xdebug.org/wizard

php.ini 配置:

zend_extension=xdebug.so

xdebug.remote_enable=1

xdebug.remote_handler=dbgp

xdebug.remote_host=127.0.0.1  # docker或虚拟机 改为主机IP
xdebug.remote_port=9001
xdebug.idekey=PHPSTORM

配置phpstorm:

file->setting -> Languages & Frameworks ->PHP->Debug :Debug port :9001

开启右上的电话: 加上断点 ,访问网址:xxx.com?&XDEBUG_SESSION_START=PHPSTORM

如果是docker或虚拟机 需要设置目录:

file->setting -> Languages & Frameworks ->PHP->Servers   ->点击网址 :打钩 Use path mappings  在 Absolute path on the server 下面设置相应的路径

相关文章