Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to debug vscode php

Shulou Source: shulou.com Published: 2022-06-02 03:18:29 10月12日 Update

What this article shares with you is about how to debug vscode php. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. Vsc plug-in

Install PHP Debug

Plug-in PHP Extension Pack2. Not now-- skip the vs code setting

...

...

"php.validate.executablePath": "D:/BtSoft/WebSoft/php/7.1/php.exe"

}}

3. Configure xdebug

Many large software, {phproot} / ext/ already have xdebug.dll

1. Manual

Create a test.php, create a statement phpinfo ();, and paste the resulting information into the XDebug installation wizard page of the XDebug official website. This page will analyze your PHP environment.

Download XDebug.dll

Copy to {phproot} / ext/

two。 One button

One-click installation

Pagoda panel, in the setting of a certain version of php, install extended XDebug

-

In {phproot} / php.ini

[XDebug]

Zend_extension = "D:\ BtSoft\ WebSoft\ php\ 7.1\ ext\ php_xdebug-2.9.1-7.1-vc14-nts.dll"

Xdebug.auto_trace=on

Xdebug.collect_vars = on

Xdebug.collect_params=on

Xdebug.collect_return=on

Xdebug.remote_enable = on

Xdebug.remote_handler = dbgp

Xdebug.remote_host = localhost

# here is the vscode receiving port sent by xdebug to vscode (needed in vscode configuration). The default is 9000. If there is a conflict, it will be changed to another port.

Xdebug.remote_port = 9000

Xdebug.remote_autostart=on

# this is the configuration for xdebug debugging in phpstorm, not used in vscode

Xdebug.idekey = phpstorm

# xdebug3

[XDebug]

Zend_extension=

Xdebug.mode=debug

Xdebug.start_with_request=yes

Xdebug.client_port=9000

Turn off debug port 9000 firewall

Restart php

4. You must open your php project directory before you can set up debug

Click on the gear, select php-- "Select listen for xdebug"

.vscode\ launch.json

Port set to 9000

5. Start debugging at F5. Browsers access debuggable web pages

The above is how to debug vscode php. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Port configuration plug-in more knowledge article page one click selection utility no information pagoda that is work meeting manual article browser version environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi vpn Shulou Tech Info OPPO Reno Shulou Technology