In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example of using VS Code breakpoints to debug PHP. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Debug PHP using VS Code breakpoints
Vs code uses an excellent lightweight code editor with numerous and growing plug-in tools. Using vs code to debug php code is more convenient and concise, so let's take a look at it.
1. Install the XDebug extension
The most common way to debug php code is the XDebug extension. First, we need to install this extension tool.
Below, I recommend a very convenient method to install the XDebug extension. First, create a phpinfo file to get the contents of the phpinfo, and copy them to the input box in the XDebug detection URL, as shown below:
After a while, the website will analyze the most suitable xdebug version for your current php environment and provide a download link, as shown in the following figure:
When the download is complete, copy the file to the extension directory of php, that is, the ext folder in the installation directory.
two。 Set PHP to use XDebug
Add a line of zend_extension=path/to/xdebug to the php.ini configuration file, where path/to/xdebug is the installation directory of xdebug and the file name.
Now, if you look at the output of the phpinfo file again, you should see that xdebug is enabled.
3. Enable remote debugging
Add a configuration item for xdebug to the php.ini configuration file:
[XDebug] xdebug.remote_enable = 1xdebug.remote_autostart = 1
4. Add extensions to VS Code
Search vs code for the PHP Debug extension and install it.
After the installation is complete, you can test it. Start debugging in the debug interface of vs code, and choose to add the configuration of xdebug.
This is the end of this article on "debugging PHP with VS Code breakpoints". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.