几天前,我在UBUNTU上安装了Visual Code。 每个扩展都可以正常工作,但Xdebug否(https://github.com/felixfbecker/vscode-php-debug)。
我创建了文件“ /home/sitesphp/wwwarchive22072017/testxdebug.php”:
<?php
$a[] = 1;
var_dump($a);
?>
在Visual Studio中,我认为当我单击DEBUG>启动当前打开的脚本时,将描述/显示变量。是不是 在我这边,什么都没显示。
这是我的设置:
在带有phpinfo();
的.php文件中,我得到了以下结果:
该程序利用Zend脚本语言引擎:Zend Engine v3.2.0,版权所有(c)1998-2018 Zend Technologies 与Zend OPcache v7.2.24-0ubuntu0.18.04.1,版权所有(c)1999-2018,Zend Technologies 与Xdebug v2.8.0,版权(c)2002-2019,作者Derick Rethans
那我想xDebug已正确安装(请参阅https://xdebug.org/docs/install)
我的launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/home/sitesphp/wwwarchive22072017/": "${workspaceFolder}"
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 3000
}
]
}
我在phpinfo()中得到“ / home / sitesphp / wwwarchive22072017 /”; > $ _SERVER ['DOCUMENT_ROOT']。也许是问题所在?
我的settings.json:
{
"php.validate.executablePath" : "/usr/bin/php",
"workbench.colorTheme": "Monokai",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"editor.detectIndentation": true,
"editor.renderWhitespace": "all",
"editor.showFoldingControls": "always",
"editor.tabSize": 1,
"editor.wordWrap": "off",
"editor.formatOnPaste": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.fontSize": 18,
"workbench.iconTheme": "vscode-icons",
"vsicons.dontShowNewVersionMessage": true,
"editor.minimap.showSlider": "always",
}
THX为您提供帮助