Build process completed successfullyInstalling '/usr/lib/php/20151012/xdebug.so'install ok: channel://pecl.php.net/xdebug-2.7.2configuration option \"大众php_ini\"大众 is not set to php.ini locationYou should add \公众zend_extension=/usr/lib/php/20151012/xdebug.so\公众 to php.ini查看ini文件
php --ini编辑ini文件
添加以下内容
[xDebug]zend_extension=\"大众/usr/lib/php/20151012/xdebug.so\"大众xdebug.remote_enable = 1xdebug.remote_autostart=on
zend_extension: 配置xdebug扩展库路径
xdebug.remote_enable: 启动远程调试;默认端口9000

xdebug.remote_autostart: 启动启动远程调试
配置vscode支持xdebug安装PHP Debug扩展。这可以通过单击VSCode中的扩展选项卡并搜索“PHP Debug”来完成
然后,单击左侧窗格中的Debug选项卡,单击debug下拉列表并选择Add Configuration。
然后,从弹出的下拉列表中单击“PHP”选项。
在此之后,VSCode将在VSCode文件夹内的根目录中创建一个launch.json文件。
第一步
第二步
第三步
第四步
编辑测试文件<?php$a=\"大众变量1\公众;$b=1;echo $a.$b?>启动做事器
php -S 0.0.0.0:3000启动vsc的调试
设置断点到第4行
访问页面在浏览器中访问页面;可以看到vscode的断点和变量数据