问题
so im trying to get sublime text 2 to run along with x-debug i have installed the
Kindari-SublimeXdebug
and i have wamp (i have enabled xdebug ) here is the php.ini configuration
; XDEBUG Extension
zend_extension =
"c:/wamp/bin/php/php5.3.10/zend_ext/php_xd
ebug-2.1.2-5.3-vc9-x86_64.dll"
[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name =
cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.remote_connect_back = On
xdebug.remote_autostart = On
but still every time i try to connect to it through sublime it though :
Xdebug : is not running
even though in my phpinfo() ; it shows that it runs probably .. sorry im still new to x-debug and sublime ... thanks in advance
回答1:
I think you need to add the following lines to the xdebug configuration in php.ini
:
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
回答2:
Although it sounds like you moved on, I'll add this for anyone else coming across your question...
I'm also running WAMP and had no problems getting Xdebug to work with Sublime Text 2. Make sure you follow the Tailored Installation Instructions for Xdebug, which should set you up with the appropriate Xdebug DLL and php.ini statements (make sure you're editing the correct php.ini!), equivalent to the following (which pretty much match what @Duke and @jasonmcclurg already said above):
zend_extension = "D:\Program Files (x86)\Wamp\bin\php\php5.3.6\ext\php_xdebug-2.2.2-5.3-vc9.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
You can check if Xdebug is properly installed on your local server by checking the output of phpinfo()
, refer to the Xdebug FAQ for some specifics.
As per SublimeXdebug's Readme, use Shift+F8 in Sublime and select Start Debugger from the drop down that appears, then set a breakpoint in your PHP code (put the caret on the desired line of PHP code, press Shift+F8, select Add/Remove Breakpoint).
To trigger remote debugging (get xdebug to connect), append the query string?XDEBUG_SESSION_START=1
to your local site's URL (e.g., http://localhost/index.php?XDEBUG_SESSION_START=1
) or use a browser extension/addon that does the equivalent for you (e.g., xdebug_session helper for Chrome, or, which is what I use, easy Xdebug for Firefox). Yet another alternative is to have SublimeXdebug trigger remote debugging automatically, see refer SublimeXdebug's Readme for details.
Once your browser requests a page which references the PHP file with your breakpoint (and assuming the PHP interpreter actually reaches the specific line with your breakpoint, i.e., your script doesn't branch elsewhere, or your app/CMS doesn't return a cached page, possibly forfeiting execution of your script), execution should halt at the breakpoint...
If everything is set up correctly but your breakpoint is not reached, SublimeXdebug briefly displays "Xdebug: Page finished executing. Reload to continue debugging." on Sublime's status bar when the browser finishes loading a page.
来源:https://stackoverflow.com/questions/11586804/run-xdebug-with-sublime-text-2