网上找了半天,终于翻到个最方便的完整的,下面整理一下
工具:


第一步:

网上说要 php.ini 中啥啥啥的操作,其实 phpstudy 自动给设置好了
第二步:
安装两个VSCODE的插件,如下图

第三步:



"php.validate.executablePath": "D:\\soft\\phpstudy64\\phpstudy_pro\\Extensions\\php\\php7.3.4nts\\php.exe",
第四步:
可以使用了

注意:
网上就是直接第四步了,然后我怎么也没看到这个界面,后来找到一篇文章说要配置那个 launch.json

直接点击创建 launch.json ,会在自己的项目根目录下自动创建一个这个文件,然后在里面配置一下就可以了


这里的端口我猜就是和前面phpstudy 开启xdebug的端口对应的地方,我也没高兴去验证,反正能用了
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
}
]
}
网友评论