Before www.leapsoul.cn, I introduced the PHP development tool ZendStudio7 getting started tutorial. In fact, it is very convenient to debug PHP using zendstudio. zendstudio supports the debugging tool zenddebugger by default and third-party debugging tools, today, I will share with you how to use zendstudio to configure Xdebug to debug the PHP program.
Http://www.leapsoul.cn before I introduced the PHP development tool Zend Studio7 getting started tutorial, in fact, the use of zend studio debugging PHP is very convenient, zend studio default support debugging tool zend debugger also allows the use of third-party debugging tools, today, we will share with you how to use zend studio to configure Xdebug to debug PHP program.
Http://www.leapsoul.cn
Previously, I introduced the PHP development tool Zend Studio7 getting started tutorial. In fact, it is very convenient to debug PHP using zend studio,
Zend studio supports the debugging tool zend debugger and third-party debugging tools by default.
This article describes how to use zend studio to configure Xdebug to debug PHP programs.
Before using Xdebug to debug PHP source code in zend studio, install and configure Xdebug. This is a basic tutorial.
Test the PHP debugging tool Xdebug installation and configuration tutorial, Xdebug combined with zend studio in the configuration is still a little different.
Before using Xdebug to debug PHP source code in zend studio, configure Xdebug for zend studio. Otherwise
You cannot use Xdebug to debug PHP.
Xdebug for zend studio
Open the PHP installation directory (how to install and configure PHP ?) Under the PHP. INI configuration file, my directory is C: \ PHP, find Xdebug
Configuration information. Add the following Xdebug configuration information.
Xdebug. remote_enable = true // Xdebug allows remote IDE connection to xdebug. remote_host = 127.0.0.1 // ip address of zend studio that can be connected xdebug. remote_port = 9000 // reversely connects to the port xdebug used by zend studio. remote_handler = dbgp // application layer communication protocol used for remote debugging of zend studio
Important:One problem that is easily overlooked here is the configuration of xdebug. remote_host information. If you are using a LAN or a wireless router,
It is useless to configure xdebug. remote_host to 127.0.0.1, and zend studio cannot be used to debug PHP and zend studio.
The single-step debugging button is invalid! You must configure xdebug. remote_host as the actual address of the zend studio installation machine. The IP address is
View through ipconfig. Because I use a wireless router, I configure xdebug. remote_host to 192.168.1.100.
Restart the apache server.
OK. Now we can use Xdebug for debugging in zend studio.
Zend studio supports debugging PHP by default. Therefore, you must first Debug zend studio PHP
To use Xdebug.
Step 1 of zend studio using Xdebug to debug PHP
Open zend studio7, select Project> Properties, and select the PHP Debug option on the left in the pop-up interface,
Check the Enable project specific settings option, select the Xdebug option in the PHP Debugger option, and finally
Click OK.
Note:When zend studio is used to debug PHP, sometimes a problem occurs, that is, zend studio is not used to debug PHP files.
Xdebug for debugging. You can click the project window at the top left to select a specific project or project file, right-click and select Properties.
Configuration, the interface is the same.
Use Xdebug to debug PHP source code in zend studio
Use zend studio to Debug PHP, mainly through the Debug As menu, there are three options: PHP Script, PHP Web Page,
PHP Unit Test, where PHP Web Page is selected. Because the same PHP file may exist before zend studio is used to debug PHP and
Xdebug is not selected. To clear the old debugging file, you can clear the preceding three types of zend studio from the Debug debuations menu.
For files in debugging mode, PHP Web Page is selected here, so you only need to clear the files in this option.
Debug Configurations can be entered in three ways: 1. Right-click the PHP file to be debugged, select Debug As or open the Debug
PHP file; 2. Select Debug As under the Run menu on the menu bar; 3. Click the down arrow next to the little spider icon below the Run menu bar
Select Debug Configurations.
After the Debug Configurations configuration is complete, open the PHP file that needs to be debugged using zend studio and select
PHP Web Page option. Check the Launch Url and click OK to debug. Xdebug debugs the PHP file in zend studio.
You can debug the PHP file through one-step debugging (F5). As long as the Xdebug configuration is correct, the selected light green appears in the debugging code window.
Background code. Otherwise, the single-step debugging (F5) function is invalid.
Finally, you can see zend studio debugging in the D: \ PHPWeb \ xdebug \ trace and D: \ PHPWeb \ xdebug \ profiler directories.
The debugging information file cachegrind. out. * And trace. *. xt output by Xdebug in PHP.
Now, the basic tutorial on using zend studio to configure Xdebug to debug PHP source code is complete, and more zend studio debugging will be introduced in the future.
PHP source code tutorial.