I was config success to debug in PHP on VSCode.
My problem is when I run the project it always errors at the function:
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;
}
... from file: /srv/http/laravelproject/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php
I can't debug to breakpoint I was set.
Gif screen record: http://i.imgur.com/6pNkoHe.gif
The most common problem is that you did not set up launch.json or there is a syntax error in that file. Alternatively, you might need to open a folder, since no-folder debugging does not support launch configurations.
Enable or disable debug mode using app. Open the app. php file located in your config/app. php laravel project. Search for debug key and change true to enable debug mode and false for disabling debug mode default it will show false.
Had the same issue when using Docker with VsCode and xDebug in Laravel.
For anyone interested in a different approach (since Laravel 5.6 there is no optimize
command anymore)
Just add the ignore
section to your launch.json
config.
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}",
},
// add this
"ignore": [
"**/vendor/**/*.php"
]
},
Solved the issue for me.
Got this from Docker Github Repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With