在按照Jerry的公众号文章 什么?在SAP中国研究院里还需要会PHP开发? 进行XDebug在本地的配置之后,如果想使用Visual Studio Code而不是Eclipse来调试PHP应用,步骤也比较简单。

启动WAMP服务器,确保xdebug.remote_autostart, xdebug.remote_enable都为on:

然后安装Visual Studio Code的扩展:PHP Debug

安装完毕后,File->Preferences->Settings:

添加一条entry:php.validate.executablePath, 指向你本地的php.exe

创建一个PHP debug configuration,有两种方式选择:

Launch current open script和Listen for Xdebug:



{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
"runtimeExecutable":"C:\\MyApp\\wamp20190709\\bin\\php\\php7.0.10\\php.exe"
}
]
}

前者调试PHP CLI应用比较方便,打开一个php文件,直接F5,断点即触发。



如果选择成Listen for XDebug,同样先F5启动调试进程,

然后浏览器里访问待调试的PHP文件,Visual Studio Code的断点即触发,可以单步调试了:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

最新文章

  1. Android中开发工具Android Studio修改created用户(windows环境)
  2. static lib和dynamic lib
  3. Oracle11G安装之后
  4. 最好用的汉字转拼音代码PinYin4Objc(PinYin4J的objc版本)
  5. 用BroadcastReceiver监听网络状态的变化
  6. spring的定时执行代码 跑批
  7. angular项目——小小记事本2
  8. wamp的安装--亲测有用
  9. [STM32F429-DISCO-HAL]4.Uart 的使用
  10. Transformer
  11. 关于macOS 管理员(Admin)权限问题。
  12. pandas 必背函数操作
  13. Python module ---- argparse
  14. matlab 整局-部视知觉实验(读取excel点阵设计图替换数据)
  15. 022_nginx常用模块之ngx_http_upstream_check_module
  16. attr VS prop 区别
  17. POI写Word换行
  18. 矩阵乘法np.dot()及np.multipy()区别
  19. 【转载】TypeScript学习笔记——var与let
  20. .NET:CLR via C# Manifest

热门文章

  1. 阶段5 3.微服务项目【学成在线】_day09 课程预览 Eureka Feign_06-Feign远程调用-Ribbon测试
  2. VCL组件之TPanel
  3. 定期删除IIS日志文件
  4. iOS-收起键盘
  5. 上下文管理器之__enter__和__exit__
  6. sonar:soanrqube接口api
  7. matplotlib中的imshow()
  8. C#学习笔记06--类/对象/访问修饰符/方法
  9. 第一周-----基本数据类型(primitive data type)
  10. FastJson反序列化获取不到值