0%

在配置linux+php+vscode+xdebug时遇到的问题

首先在用户配置json配置这个,用于显示默认配置

1
"workbench.settings.useSplitJSON": true,
### 源形式

安装对应版本的php(版本号)-dev,可以使用phpize命令

1
apt install php版本号-dev

检查你是否使用fpm启动php,如果是fpm,请添加语句到fpm目录下的php.ini

1
2
3
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1

### 源码形式

下载xdebug源码包,解压进入目录,运行phpize生成configure

1
2
3
4
phpize
./configure
make
make intall
得到.so路径,添加上述允许远程调试的指令,并添加引用目录
1
zend_extension = php_xdebug.so

当你可以在phpinfo页面看到xdebug以及 xdebug.remote_enable 与 xdebug.remote_autostart 为on时则说明开启成功

恰饭,恰饭