Xdebug is a good helper for PHP debugging, Sublime is a good helper for PHP writing. Here only how to configure, default readers will use sublime text and Xdebug
Installing Xdebug
Ubuntu under Installation: Ubuntu 12.04 under install config PHP debug tool xdebug
Windows Installation: PHP debugging tool Xdebug installation and use of--xdebug simple introduction
Xdebug need to turn on remote_enable in PHP config file Phpl.ini:
Xdebug.remote_enable = On
Otherwise the Xdebug client will not work properly.
Configuration Sublime Text
To debug a project, you first need to save the project under sublime as one project:
Sublime->project->save Project as ...
Then install the Xdebug Client with the package control:
Ctrl+shift+p->pci->xdebug Client
Next configuration item:
Sublime->project->edit Poject
The configuration file resembles the following:
{" folders": [ { "follow_symlinks": True, "path": "." } ], "settings": { " Xdebug ": { " url ":" http://my.local.website/", }} }
Where the URL is the URL of the project, remember to point the URL to 127.0.0.1 in the hosts, and in Apache VirtualHost point it to the project root directory
This is OK, ready to start debugging.
Start debugging
Debugging mode is also relatively simple, where you want to add a breakpoint right-click
Xdebug->add/remove Breakpoint
So the project will stop when it runs to the bank.
Then start debugging, and in the menu bar select
Tools->xdebug->start Debugging (Launch browser)
Sublime will automatically open the browser, enter the configuration of the site link to write, to debug
The functions used in debugging can be viewed in the debug file by right-clicking the
Possible problems
Breakpoint cannot be traced
This may be the Xdebug port is occupied, press CTRL + ' or the menu bar View->show console to view the error message, it is possible that the Xdebug port has been occupied for the sake of.
Turning off debugging in sublime Xdebug, or restarting sublime, can solve this problem.