Zend studio uses breakpoint debugging, zendstudio

Source: Internet
Author: User
Tags php debugger

Zend studio uses breakpoint debugging, zendstudio

1. Download Xdebug

1 #
2 # http://xdebug.org/download.php
3  
4 # Search for Xdebug downloads corresponding to your installed php version
5 # For php in Windows, you can view the print information of the phpinfo () function and find "PHP Extension Build". Check that your PHP version is VC,

2. Install

1 # Installation instructions
2 # http://xdebug.org/docs/install
3  
4 # For Windows, after the download is complete, rename the downloaded dll file to php_xdebug.dll
5 # Copy it to the PHP extension directory (for example: D: \ Program Files \ EasyPHP-5.3.2i \ php \ ext \)

3. Modify php. ini.

01 # Add a section 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 data file directory
07 xdebug.profiler_output_dir="E:/xdebug"Xdebug data file directory
08 Xdebug. max_nesting_level = 10000; if it is too small, an error occurs when the number of recursive calls in the function exceeds the maximum number of embedded sets.
09  
10 xdebug.remote_enable=true; Xdebug allows remote IDE connection
11 Xdebug. remote_host = 127.0.0.1; IP address of zend studio that can be connected
12 Xdebug. remote_port = 9000; reverse connect to the port used by zend studio
13 Xdebug. remote_handler = dbgp; application layer communication protocol used for remote debugging of zend studio

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) {
4         echo 'aa';
5     }
6 }
7 ?>

6. Create a Debug command.

1 # Click the arrow next to "little spider" on the toolbar-> Debug As-> PHP Web Page
2 # Will jump out of the Debug View
3 # Add a breakpoint before the line "if ($ I = 5) {" to perform one-step debugging.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.