1. install and configure PDT
Download PDT: download.eclipse.org/tools/pdt/downloads/index.php and select the latest version.
PDT is the plug-in of Eclipse.
Select the PDT-all-in-one version. Otherwise, you need to download eclipse and related plug-ins and integrate them manually.
2. Install the debug environment
Because I used the latest xampp1.7.2 and tried xdebug for two days, the following example is displayed: Waiting For xdebug session. The program cannot be debugged because the process stops at 57%. It may be a problem between xdebug and php5.3. Therefore, we decided to use the old version xampp1.6.8 and PHP version 5.2.6. The above problem still occurs, so I cannot solve it. I cannot change it to Zend debugger.
The XAMPP version is 1.6.8. Download Zend debugger 5.2.x from here. Decompress the file and copy it to the \ XAMPP \ PHP \ ext directory.
Open PHP. ini in the \ XAMPP \ apache \ bin directory. To add:
Zend_extension_ts = "C: \ XAMPP \ PHP \ ext \ zenddebugger. dll"
Zend_debugger.allow_hosts = maid/10,192.168 .88.146
Zend_debugger.expose_remotely = always
192.168.88.146 is the IP address on your computer.
3. Set the debug environment under PDT
Start eclipse and set the code directory to "XAMPP \ htdocs". In this way, the code is directly stored in the Apache web directory.
Open "WINDOW> preferences> PHP" from the main menu ",
Select the "php excutables" node and click "add" on the right panel. In the following window,
Select the "debug" node. On the right panel,
"Php Debugger" select xdebug,
"Server" does not need to be changed
"Php executable" also selects the "XAMPP-Zend" you just added"
In the PHP debug perspective, you can click the icon in the debug view or use a shortcut key to track a single step, for example:
F5: One-Step Jump (you can jump into the require () function to track other PHP files)
F6: Skip in one step
F7: One-Step Jump (you can jump back to the caller from the file being require)
F8: continue execution (until the next breakpoint is encountered)
CTRL + R: Execute to the row where the cursor is located (unless a breakpoint is encountered)