【发布时间】:2017-01-27 14:26:21
【问题描述】:
我正在尝试使用 wamp、xdebug 和 this 扩展名调试我的 php,但我无法让它工作。我的php.ini到此结束(C:\wamp64\bin\php\php7.0.4\php.ini):
[Xdebug]
zend_extension ="C:/wamp64/bin/php/php7.0.4/ext/php_xdebug-2.4.1-7.0-vc14-x86_64.dll"
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.profiler_output_dir ="c:/wamp64/tmp"
我的launch.json(C:\wamp64\www\CubePicker.vscode\launch.json):
{
"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
}
]
}
Settings.json:
// Place your settings in this file to overwrite the default settings
{
"emmet.syntaxProfiles":
{
"php": "html"
},
"php.validate.executablePath": "C:/wamp64/bin/php/php7.0.4/php.exe",
}
谁能看到我做错了什么?我在 VS Code 中启动调试器,然后通过我的浏览器运行网页,我认为这是正确的......?我怎样才能解决这个问题并让它到达我设置的断点?
如果您还需要什么,请告诉我。
谢谢!
[编辑]:我进入了 phpinfo(),找到了加载的 php.ini 的路径,并对其进行了编辑以添加第一块代码。这并没有解决问题。
[编辑]:我还在这里复制了我的整个 phpinfo():http://pastebin.com/4Jk5TuQj
【问题讨论】:
-
如果您正在运行 php.exe,那么也将 XDEBUG 参数添加到
\wamp\bin\php\php7.0.4\php.ini。该 ini 文件控制 PHP CLI,默认情况下没有配置 XDEBUG -
这与 \wamp64\bin\php\php7.0.4\php.ini 有什么不同吗?如果有,它在哪里?
-
phpinfo()中列出了你需要编辑的文件,编辑后重启服务。 -
我刚刚编辑了那个文件并添加了相同的配置,但它仍然没有达到断点...
标签: php json debugging visual-studio-code