PHP XDebug Sublime Text single-Step debugging

Source: Internet
Author: User
Tags pear sublime text

Pre-environment: The LNMP has been installed.

1. Installing Xdebug

Can be installed through Pear package management

sudo apt-get install Php-pear

sudo pecl install Xdebug

Here we install directly via apt

Apt-get Install Php5-xdebug

The program has automatically created the default configuration file

Configuration:

Xdebug.ini Location:/etc/php5/mods-available/xdebug.ini

Add the following

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. Turn on commissioning


Sublime CRL+ALT+F9 Open the Debug interface

View Port 9000

3. Testing

Create File test.php

<?php

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

echo $i;

}

?>

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

Where we can see the breakpoint $i = 0

Shift+f8: Open the Debug panel
F8: Open the debug panel quick Connect
Ctrl+f8: Toggle Breakpoint
CTRL+SHIFT+F5: Run to the next breakpoint
CTRL+SHIFT+F6: Single Step
Ctrl+shift+f7: Step Into
Ctrl+shift+f8: Step Out

Ctrl+shift+f7

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

PHP x-debug File

Ubuntu below has kcachegrind directly open, convenient trace file loading order

PHP XDebug Sublime Text single-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.