This article contains the following content:
1. Xdebug file download and configuration
Enter the Xdebug download page and select the appropriate Xdebug version according to the prompts.
In the Xdebug download page, you need to copy the source code of the local phpinfo() into the text box. Taking Chrome as an example, press F12 to view the phpinfo() source code, right-click ->Copy->Copy element, fill the copied content into the text box, click the Analysemy phpinfo() output button below, and Xdebug will prompt to download Which file and how to configure it.
Configure the php.ini file according to Xdebug prompts. My configuration file is as follows
zend_extension =D:\AppServ\php5\ext\php_xdebug-2.4.0-5.6-vc11.dll xdebug.remote_enable = On xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.remote_port = 9000 xdebug.idekey= PHPSTROM
2. IDE (PhpStorm) initiates debugging
After the first step of configuration, we can see the Xdebug configuration information in the phpinfo() output information. At this point, it means that php's extension of Xdebug has been completed, and the next step is to configure PhpStorm.
Click the "Run/Debug Configurations" button in the upper right corner and select Edit Configurations.
Select the PHP Web Application item
Set the corresponding information according to your own situation, click OK
You can see the "Run" and "Debug" buttons are lit, and when you need to interrupt Click the debugging page to set a breakpoint, and then click the debug button to enter debugging mode.
3. Debugging initiated by Chrome
The characteristic of debugging initiated by IDE (PhpStorm) is that the web page is opened by the IDE, and the configuration information needs to be changed frequently, which is very inconvenient to use. Chrome initiates debugging, just like normal web page debugging. The configuration method is as follows:
PhpStorm configuration
Open PhpStorm and enter File->Settings->PHP->Servers, fill in the server-related information.
Enter File->Settings->PHP->Debug, set the Debug port to 9000.
Enter File->Settings->PHP->Debug-> DBGp Proxy, configure IDE key, Host, Port and other information.
Turn on the phone button in the upper right corner of PhpStorm to maintain debugging and monitoring.
Chrome Configuration
Download and add the Chrome plugin. After the plug-in is installed, as shown in the figure
Click the icon on the page that needs to be debugged, select Debug and refresh again to see the breakpoint debugging information of Php.
The above introduces the PHP+PhpStorm+Xdebug configuration method, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.