van*_*loc 6 php debugging laravel visual-studio-code
我在VSCode上用PHP调试配置成功.
我的问题是当我运行项目时,它总是在函数中出错:
protected function getJsonPayload($payload)
{
$payload = json_decode(base64_decode($payload), true);
// If the payload is not valid JSON or does not have the proper keys set we will
// assume it is invalid and bail out of the routine since we will not be able
// to decrypt the given value. We'll also check the MAC for this encryption.
if (! $this->validPayload($payload)) {
throw new DecryptException('The payload is invalid.');
}
if (! $this->validMac($payload)) {
throw new DecryptException('The MAC is invalid.');
}
return $payload;
}
Run Code Online (Sandbox Code Playgroud)
... 从文件: /srv/http/laravelproject/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php
我无法调试我设置的断点.
Gif屏幕记录:http://i.imgur.com/6pNkoHe.gif
小智 10
在Laravel中使用Docker与VsCode和xDebug时遇到同样的问题.
对于任何对不同方法感兴趣的人(因为Laravel 5.6 optimize不再有命令)
只需将该ignore部分添加到您的launch.json配置即可.
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}",
},
// add this
"ignore": [
"**/vendor/**/*.php"
]
},
Run Code Online (Sandbox Code Playgroud)
为我解决了这个问题.
从Docker Github Repo得到了这个