martomo / SublimeTextXdebug

Xdebug debugger client for Sublime Text
MIT License
564 stars 89 forks source link

Error connecting to Xdebug session #98

Open tobycurl opened 10 years ago

tobycurl commented 10 years ago

Some time within the last week xdebug has stopped working with this package. I cannot think of any significant changes to my machine. PHP and Xdebug haven't changed versions as far as I can see (and I don't remember updating them). I tried this suggestion: https://github.com/martomo/SublimeTextXdebug/issues/63#issuecomment-40259766 so I think xdebug itself is working.

User settings for the package:

{
    "close_on_stop": true,
    "debug": true
}

Xdebug.ini:

[xdebug]
zend_extension="/usr/local/Cellar/php54-xdebug/2.2.5/xdebug.so"
xdebug.remote_enable = 1
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_log = "/tmp/xdebug.log"

xdebug.max_nesting_level = 200
xdebug.profiler_enable_trigger = 1
xdebug.show_exception_trace = 1

xdebug.var_display_max_data = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_depth = -1

The test page is:

<?php
phpinfo();
?>

With the breakpoint on the "phpinfo();" line.

The error I am getting in the sublime text console when I reload my test page (after starting the Xdebug package in sublime text and turning on the Firefox Xdebug plugin) is:

Exception in thread Thread-18:
Traceback (most recent call last):
  File "X/threading.py", line 639, in _bootstrap_inner
  File "xdebug.session in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 148, in run
  File "xdebug.session in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 204, in execute
  File "xdebug.session in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 460, in watch_expression
  File "xdebug.session in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 320, in get_watch_values
  File "xdebug.protocol in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 220, in send
  File "xdebug.helper.helper in /Users/user1/Library/Application Support/Sublime Text 3/Installed Packages/Xdebug Client.sublime-package", line 45, in base64_encode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1079-1084: ordinal not in range(128)

The xdebug.log file is:

Log opened at 2014-08-19 11:52:00
I: Checking remote connect back address.
I: Remote address found, connecting to 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/user1/Web/info.php" language="PHP" protocol_version="1.0" appid="2459" idekey="sublime.xdebug"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_children -v 32
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>

<- feature_set -i 3 -n max_data -v 1024
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_data" success="1"></response>

<- feature_set -i 4 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="max_depth" success="1"></response>

<- breakpoint_set -i 5 -f file%3A///Users/user1/Web/info.php -n 2 -t line
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="24590001"></response>

<- breakpoint_set -i 6 -t exception -x "Fatal error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6" id="24590002"></response>

<- breakpoint_set -i 7 -t exception -x "Catchable fatal error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="7" id="24590003"></response>

<- breakpoint_set -i 8 -t exception -x "Warning"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="8" id="24590004"></response>

<- breakpoint_set -i 9 -t exception -x "Parse error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="9" id="24590005"></response>

<- breakpoint_set -i 10 -t exception -x "Notice"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="10" id="24590006"></response>

<- breakpoint_set -i 11 -t exception -x "Strict standards"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="11" id="24590007"></response>

<- breakpoint_set -i 12 -t exception -x "Deprecated"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="12" id="24590008"></response>

<- breakpoint_set -i 13 -t exception -x "Xdebug"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="13" id="24590009"></response>

<- breakpoint_set -i 14 -t exception -x "Unknown error"
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="14" id="24590010"></response>

<- run -i 15
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="15" status="break" reason="ok"><xdebug:message filename="file:///Users/user1/Web/info.php" lineno="2"></xdebug:message></response>

<- eval -i 16 -- SW5wdXQ6OmdldCgic3ViamVjdCIp
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="16" status="break" reason="ok"><error code="206"><message><![CDATA[error evaluating code]]></message></error></response>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="16" status="stopping" reason="ok"></response>

Log closed at 2014-08-19 11:52:10

Any help would be greatly appreciated.

kalecgos0616 commented 7 years ago

Hi, @tobycurl . I also have this problem that there are error message in sublime console as following: ... UnicodeEncodeError: 'ascii' codec can't encode characters in position 1079-1084: ordinal not in range(128) My solution is to use sublime text 2. But I don't think it's a good solution for here.