PHPXDebugSublimeText single-step debugging

Source: Internet
Author: User
: This article mainly introduces the single-step debugging of PHPXDebugSublimeText. For more information about PHP tutorials, see. Prerequisites: LNMP has been installed.

1. install xdebug

You can use the pear package management to install

Sudo apt-get install php-pear

Sudo pecl install xdebug

Here we will install it directly through apt

Apt-get install php5-xdebug

The program has automatically created the default configuration file

Configuration:

Xdebug. ini location:/etc/php5/mod-available/xdebug. ini

Add as follows

Zend_extension = "/usr/lib/php5/20131226/xdebug. so"

Xdebug. profiler_output_dir =/tmp

Xdebug. profiler_output_name = cachegrind. out. % p

Xdebug. profiler_enable_trigger = 1

Xdebug. profiler_enable = true

Xdebug. remote_enable = true

Xdebug. remote_host = 127.0.0.1

Xdebug. remote_port = 9000

Xdebug. remote_handler = dbgp

Xdebug. remote_mode = req

Xdebug. remote_connect_back = 1

Xdebug. remote_autostart = 0

Xdebug. collect_vars = On

Xdebug. collect_params = On

Xdebug. auto_trace = On

Xdebug. show_exception_trace = On

Xdebug. trace_output_dir =/tmp

Restart PHP5-FPM

/Etc/init. d/php5-fpm restart

2. enable debugging


In sublime, CRL + ALT + F9 open the debugging interface

View Port 9000

3. test

Create file test. php

For ($ I = 0; $ I <10; $ I ++ ){

Echo $ I;

}

?>

Access http: // 127.0.0.1/test. php in a browser

We can see where we breakpoint $ I = 0

Shift + f8: Open the debugging panel
F8: enable the debugging panel for quick connection
Ctrl + f8: switch the breakpoint
Ctrl + Shift + f5: run to the next breakpoint
Ctrl + Shift + f6: single step
Ctrl + Shift + f7: Enter
Ctrl + Shift + f8: Exit

CTRL + SHIFT + F7

Address: http://www.cnblogs.com/martin-tan/p/4921200.html

Php x-Debug files

KCachegrind is directly opened under UBUNTU to facilitate the loading sequence of trace files.

The above introduces PHP XDebug Sublime Text single-step debugging, including some content, hope to be helpful to friends who are interested in PHP tutorials.

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.