配置php xdebug

php.ini 其他默认

xdebug.show_local_vars = On
;启用远程调试
xdebug.remote_autostart= On

windows完整配置

[Xdebug]
zend_extension = php_xdebug.dll
xdebug.remote_enable = On
xdebug.remote_host = localhost
xdebug.remote_port = 9100
xdebug.show_local_vars = On
;启用远程调试
xdebug.remote_autostart= On

vscode

# 加载了 xdebug 的 php 可执行文件 
"php.validate.executablePath": "C:\\xampp\\php\\php.exe"
# 打断点
# f5 监听运行
# 浏览器浏览,断点开始运行

宝塔上linux php7.1的配置

[Xdebug]
xdebug.remote_enable = On
xdebug.remote_host = localhost
xdebug.remote_port = 9100
xdebug.show_local_vars = On
;启用远程调试
xdebug.remote_autostart= On
zend_extension=/www/server/php/71/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so


# 5.5

[Xdebug]
xdebug.remote_enable = On
xdebug.remote_host = localhost
xdebug.remote_port = 9200
xdebug.show_local_vars = On
;启用远程调试
xdebug.remote_autostart= On
zend_extension=/www/server/php/55/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so