: 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.