debugging using breakpoints in zend studio

WBOY
Release: 2016-08-08 09:25:20
Original
1717 people have browsed it

1, Download Xdebug

1 # Download address

2 # http://xdebug.org/download.php

3

4 # Find the Xdebug download corresponding to the php version you installed

5 # For the Windows version of php, you can view the printed information of the phpinfo() function, search for "PHP Extension Build", and see which version of PHP you have, which is VC,

2, Installation

1 # Installation instructions page

2 # http://xdebug.org/docs/install

3

4 # For Windows version, rename the downloaded dll file to php_xdebug.dll after the download is complete

5 # Copy it to the PHP extension directory (for example: D:Program FilesEasyPHP-5.3.2ippext)

3, modify php.ini

01 # Add a paragraph at the end of php.ini and restart Web-Server after modification

02 [Xdebug]

03 zend_extension="D:/Program Files/EasyPHP-5.3.2i/php/ext/php_xdebug.dll"

04

05 xdebug.profiler_enable=on

06 xdebug.trace_output_dir="E:/xdebug"  ;xdebug’s data file directory

07 xdebug.profiler_output_dir="E:/xdebug" ;xdebug’s data file directory

08 xdebug.max_nesting_level = 10000 ; If it is set too small, if the function calls itself recursively too many times, an error of exceeding the maximum nesting number will be reported

09

10 xdebug.remote_enable=true                                                     

11
xdebug.remote_host=127.0.0.1 ; The IP address of zend studio that allows connection

12
xdebug.remote_port=9000 ;Reverse connection to the port used by zend studio

13
xdebug.remote_handler=dbgp ; Application layer communication protocol for zend studio remote debugging
4, Modify Zend Studio settings

1
Window -> Preferences -> PHP -> Debug

2
# Set "PHP Debugger" in "Default Settings" on the left to "XDebug"
5, create a new test.php file in the project

view source print?

1
<?php

2 for($i= 0; $i< 10; $i++) {

3           if ($i==5) {

5
4                                                                                                

}6

}7

?>
6, Create a new Debug command

1

# Click the small arrow next to "Little Spider" on the toolbar -> Debug As -> PHP Web Page2

# will pop up Debug view3

# Add a breakpoint before the line "if ($i==5) {" and you can perform single-step debugging
The above introduces the use of breakpoint debugging in zend studio, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template