1. XDebug installation configuration
(1) Download XDebug Download address: http://www.xdebug.org/ You must download a version that matches the php installed on the machine. The specific download method is as follows: Copy the source code of the phpinfo web page to http://www.xdebug.org/find-binary.php, and then install it according to the instructions. As shown below:(2) Install XDebug Download "php_xdebug-2.3.2-5.4-vc9.dll" as shown above and copy it to the d:phpext directory. (3) Configure XDebug Open d:phpphp.ini and add the following code at the end:
[Xdebug]
zend_extension = d:phpextphp_xdebug-2.3. 2-5.4-vc9.dll
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
Detection method 2:
Enter php -m under cmd, and you can see that XDebug indicates that the configuration is successful. As shown below: 2. XDebug configuration in PHPStorm In the Settings of [File]->[Settings]->[Languages & Frameworks]->[PHP]: (1) Configure PHP Server Find [Servers], the configuration items are as follows: Name: localhost Host: localhost Port:80 Debugger:XDebug As shown below: (2) Configure PHP Debug Find [Debug], fill in the Debug Port in XDebug with 9000, and default to other values. As shown below: 3. Configuration of XDebog helper plug-in in Fireforx (1) Install the XDebug helper plug-in As shown below:(2) Configure XDebug helper plug-in In the picture above, click [Options] and configure as follows: IDE key: PhpStorm Domain filter: localhost As shown below: 4. Debugging methods and steps using XDebug (1) Turn on Debug monitoring in PHPStorm Click on the phone-like icon to turn on Debug monitoring, as shown in the figure below: (2) Turn on the XDebug helper plug-in in the Chrome browser Method 1: In the address bar, click on the bug and select Debug, as shown below: Method 2: Use the shortcut key: CTRL SHIFT X to configure. (3) Set breakpoints in PHPStorm Click in the blank space after the line number to set a breakpoint. (4) Breakpoint debugging Then the method directed to the corresponding breakpoint in the browser will be automatically broken, as shown in the following figure:
There are all breakpoint processing methods and shortcut key prompts in the red frame.