Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to debug vscode php

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report