M
M
malayamarisha2021-02-08 11:22:33
open server
malayamarisha, 2021-02-08 11:22:33

How to configure xdebug vscode?

Good day!
Installed OpenServer, on which a copy of Bitrix is ​​deployed.
I open the project with vscode.
I would like to set up php debugging in vscode.

To set up debugging, the following steps were performed:
1) phpinfo() was displayed on the test page;
2) the content of phpinfo(); added on https://xdebug.org/wizard
3) .dll file configured
4) dll added to openserver settings (D:\OpenServer\modules\php\PHP_7.1-x64)
5) "PHP Debug" extension installed in vscode "
6) in the php.ini settings, the port is 9001
7) in the vscode launch.json settings it is written

{
      "name": "Listen for Debug",
      "type": "php",
      "request": "launch",
      "port": 9001
    },
    {
      "type": "php",
      "request": "launch",
      "name": "Отладка",
      "program": "${file}",
      "cwd": "${fileDirname}",
      // "runtimeExecutable": "/usr/bin/php",
      "port": 9001
      },

8) in the site structure, I select the file that needs to be debugged, I click F5. I click on "Debug" 6020f499b18be545141556.jpeg
and an error occurs
6020f4a0b9e92962534727.jpeg
Tell me what I'm doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
-
----, 2021-06-07
@stalkerxxl

Same hat

M
malayamarisha, 2021-08-12
@malayamarisha

Perhaps it will help someone:
1) install the LiveServer application (screen 1) 6114e89e46aa8452222051.jpeg
2) open the file in which the js file is connected (I have a regular index.html)
3) run it using LiveServer (right-click to open the action window) (screen 2 ) 6114e8c49ded1999418817.jpeg
4) the page will open in the browser
5) pay attention to the address bar (the port is of interest. For example: localhost:5500 )
6) in VsCode go to the debugging section, generate debug json (screen 3) 6114e8b8b1389798850449.jpeg
7) in json specify the port that was opened via LiveServer
Example json:

{
  // Используйте IntelliSense, чтобы узнать о возможных атрибутах.
  // Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов.
  // Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch Chrome",
      "url": "http://localhost:5500",
      "webRoot": "${workspaceFolder}"
    }
  ]
}

8) start debugging

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question