问题
vscode+phpstudy+xdebug3搭建PHP的调试环境,一直在vscode编辑器断不下来。
解决方案
其实在vscode的插件php_debug中的说明文档已经说明的很清楚了,需要在php_ini增加两个参数
如果是 Xdebug v3.x.x,需要在php.ini文件中增加
xdebug.mode = debug
xdebug.start_with_request = yes
对于 Xdebug v2.x.x:
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug免下载激活
其实php_study已经集成了XDebug,在软件管理选择对应版本的php中的设置,可以直接激活XDebug,不用去XDebug官网下载。
这里推荐安装php8.0.2nts,可能是因为我的电脑的原因,php7.3.4对应的Xdebug调试组件无法正常激活。