I have been using Zend studio for a long time. Today, I still find that many of these functions are not used properly and are better utilized. I think they can effectively improve efficiency. Although I have been using tools such as eclipse for a long time
I am still not well developed. Today I will talk about how to use Zend debug in Zend studio for code debugging.
After Zend studio is installed, Zend debug is installed by default. It should be integrated. If no integration is found, please downloadZendServer-CE-php-5.2.17-5.1.0-Windows_x86.exe, remember to be Community edition, free of charge, which integrates a lot of functionality, such as APC, Zend debug, Apache, PHP, MySQL...
This is equivalent to an integrated environment with Zend studio. Debugging is also very convenient.
The basic process is as follows:
(1) set PHP servers,
(2) edit a PHP server to set its root directory. The root directory here is equivalent to the virtual directory set in httpd. conf.
The root address of the main debugging path is set here,
(3) Click the debug icon to display a drop-down list. SelectHere, you need to set the URL address for debugging and other information:
The URL in the lower-right corner is the URL you want to debug. The file above is the URL address to be debugged. The file corresponding to the initial file is equivalent to the file used as the entrance.
"Break at first line", The code is debugged from the first line of the entry file by default. If it is not checked, Debugging starts from the breakpoint set by the user (double-click a line of code ).
I want to explain that there is an option during debugging,, Which is equivalent to parameter tracking and is very effective. The effect is as follows:
Yesfrom
The following describes how to configure a virtual directory:
## Virtual Hosts## If you want to maintain multiple domains/hostnames on your# machine you can setup VirtualHost containers for them. Most configurations# use only name-based virtual hosts so the server doesn't need to worry about# IP addresses. This is indicated by the asterisks in the directives below.## Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/># for further details before you try to setup virtual hosts.## You may use the command line option '-S' to verify your virtual host# configuration.## Use name-based virtual hosting.#NameVirtualHost *:80## VirtualHost example:# Almost any Apache directive may go into a VirtualHost container.# The first VirtualHost section is used for all requests that do not# match a ServerName or ServerAlias in any <VirtualHost> block.#<Directory "D:\Program Files\Zend\Apache2\htdocs\Discuz"> AllowOverride None Options None Order allow,deny Allow from all</Directory><VirtualHost *:80> ServerAdmin webmaster@dummy-host.example.com DocumentRoot "D:\Program Files\Zend\Apache2\htdocs\Discuz" ServerName bbs.l00818.com.local ErrorLog "logs/bbs.local.log"</VirtualHost>
Just introduce the following content from httpd. conf:
Include CONF/extra/httpd-vhosts.conf
The configuration takes effect.
Next we will discuss how to addSometimes some code is very long and cannot be fully debugged at one time. Therefore, you need to write a todo list. Next time, you can easily go to the same location:
You can also add todo list to files that need to be edited frequently to quickly find the corresponding location. You do not need to search for elements one by one in a large system each time.
For example, we can easily track a problem,
Right-click a place where todo needs to be added:
OK.
There is also a debugging plug-in for Firefox, which can be very convenient to coordinate debugging with Zend studio. If you are interested, please refer to my other blog:
Http://blog.csdn.net/jallin2001/article/details/6268589
I still think that debugging is an important basic skill for writing PHP. For team development, its built-in SVN is also very helpful.