Home  >  Article  >  Daily Programming  >  How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

藏色散人
藏色散人Original
2018-09-14 16:43:1927064browse

For those who are new to PHP, they may not know what xdebug is. Simply put, it is a PHP program error debugging tool. Then some novice friends may ask what is the use of xdebug? The xdebug tool can be used to analyze the running status of the tracking program. The xdebug tool can help PHP personnel develop programs more efficiently, conveniently and quickly. It is an essential tool for PHP developers.

phpstorm toolDownload address://m.sbmmt.com/xiazai/gongju/122

Then this article is We will introduce in detail the specific steps of phpstorm to configure xdebug tools and their use.

1. Set xdebug configuration items

1. Open the php.ini configuration file

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

2. At the bottom of the php.ini file, find the code in the picture below and cancel the comment semicolon in front of this line of code.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

3. Set some xdebug configuration items at the bottom of the php.ini file as follows:

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

Remote port Number (here we set 9018);

Remote automatic startup item (1 means on by default, 0 means off);

Automatic tracking item (1 means on by default, 0 means off);

Remote host IP address (here we set 127.0.0.1, it can also be localhost);

Remote enable item (1 means remote enabled by default, 0 means closed).

4. Save the php.ini file and restart the Apache server.

2. phpstorm configure xdebug

1. Open phpstorm and find the settings under the file column.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

#2. In the settings, open the debug section to set the remote port number. The port number here must be the same as the port number set in your configuration file.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

#3. Open the phpstorm editing interface, click on the small phone logo in the upper right corner, and turn on xdebug breakpoint debugging. Here we open a file for testing as shown below, put a breakpoint in the file, as shown on line 12, just click the mouse.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

#4. Select a file to upload and then open phpstorm. The relevant content information of the breakpoint debugging point will be displayed at the bottom. How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

#5. If you want to continue viewing, you can choose to click the down arrow in the picture below.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

#5. Click the small square sign in the upper right corner to turn off xdebug debugging.

How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial)

The above is an introduction to the specific steps for configuring and using the phpstorm error debugging tool xdebug. This article has certain reference value. I hope it can be helpful to friends who need it!

If you want to know more about PHP, you can follow the PHP video tutorial on the PHP Chinese website. Everyone is welcome to refer to and learn!

The above is the detailed content of How to configure and use the xdebug tool in PHPStorm? (Picture + video tutorial). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn