PHP Learning-using Xdebug (Ubuntu) in sublime
Ashamed to say, since the beginning of the use of sublime text, never debug PHP code, recently set the debug environment, here to record. Install xdebug sudo apt-get install php5-xdebug edit Xdebug.ini file, add the following configuration xdebug.remote_enable=1xdebug.remote_handler= dbgpxdebug.remote_host=127.0.0.1xdebug.remote_port=9000xdebug.remote_log= "/var/log/xdebug/xdebug.log" Restart Nginx Sudo/etc/init.d/nginx Restart then use the package control to install the Xdebug client in sublime text, use the ctrl+shift+p to bring up the search box, and enter the control: Select the package Control:install, enter the Xdebug client, locate the Xdebug client, install, and restart the sublime after the installation is complete. The operation is as follows: To debug a project, you first have to save the project under sublime as an item. Sublime->project->save Project as ... The next configuration item sublime->project->edit poject configuration file resembles the following: Copy code {"Folders": [{"Follow_symlinks": True, "path": "."}], "set Tings ": {" Xdebug ": {" url ":" Http://my.local.website/",}}} Copy the code and install the Chrome xdebug Helper extension in Chrome. After you download and install the Chrome extension, you must restart the browser. After restarting, you will see a new icon in Chrome's Address bar: Clicking on it will enable/disable debugging. However, we first need to adjust the session key using Sublime Text in the extension. In Chrome Tools > Extensions Open xdebug Helper options: It's easier to start debugging, right-click where you want to add a breakpoint xdebug->add/Remove Breakpoint The project will stop when it runs to the bank and start debugging, select Tools->xdebug->start Debugging (Launch Browser) in the menu bar Sublime will automatically open the browser, enter the configuration to write the site link, for debugging. The features used in debugging can be viewed in the debug file by right-clicking. The shortcut keys are described below Start/stop debugging Sessionstart debugging-ctrl+shift+f9 or⌘+shift+f9start Debugging (Launch Browser) Restart S Essionstop debugging-ctrl+shift+f10 or⌘+shift+f10stop Debugging (Launch Browser) Stop debugging (Close Windows) Breakpoi Ntsadd/remove breakpoint-ctrl+f8 or⌘+f8set Conditional breakpoint-shift+f8clear breakpointsclear all BreakpointsWatch Expressionsset Watch Expressionedit watch expressionremove watch Expressionclear watch expressionssession Commandsevaluateexecutestatuscontinuation commandsrun-ctrl+shift+f5 or⌘+shift+f5run to LineStep over-ctrl+shift+f6 o R⌘+shift+f6step into-ctrl+shift+f7 or⌘+shift+f7step out-ctrl+shift+f8 or⌘+shift+f8stopdetachotherrestore layout/c Lose windows-ctrl+shift+f11 Or⌘+shift+f11settings-defaultsettings-user problem cannot track breakpoints this may be the Xdebug port being occupied, press CTRL + ' or the menu bar view-& Gt;shoW Console to view the error message, it is possible that the Xdebug port has been occupied for the sake of. Turn off debugging in sublime Xdebug, or restart sublime to resolve this problem, if not, you can modify the port number, such as the port number in Xdebug.ini is modified to 1000, in Perferences->package The Settings->xdebug->setting-user file includes the following: {"Port": 10000}
http://www.bkjia.com/PHPjc/859799.html www.bkjia.com true http://www.bkjia.com/PHPjc/859799.html techarticle PHP Learning-in sublime use Xdebug (Ubuntu) said ashamed, since the beginning of the use of sublime text, never debug PHP code, recently set the debug environment ...