Fedora – VS Code 配置 XDebug

VS Code 配置 XDebug 步骤如下:

1. dnf 安装 XDebug

2. VS Code 安装 PhP Debug 扩展;

3. 添加 launch.json 于项目 .vscode 目录下(使用默认);

4. 于项目 settings.json 中添加:

{
  "php.validate.enable": true,
  "php.validate.executablePath": "/usr/bin/php",
  "php.validate.run": "onType"
}

5. 配置 /etc/php.ini,添加:

; XDebug
[XDebug]
zend_extension = /usr/lib64/php/modules/xdebug.so

xdebug.remote_enable = 1
xdebug.remote_autostart = 1

参考:

  1. https://blogs.msdn.microsoft.com/nicktrog/2016/02/11/configuring-visual-studio-code-for-php-development/

作者: YanWen

Web 开发者

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s