Can't using Visual Code to debug in Laravel project

后端 未结 4 1966
你的背包
你的背包 2021-01-05 03:46

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 getJsonPayl         


        
4条回答
  •  轮回少年
    2021-01-05 04:16

    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

提交回复
热议问题