martomo / SublimeTextXdebug

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

Xdebug can't parse xml response #80

Closed HoffmannP closed 10 years ago

HoffmannP commented 10 years ago

I'm getting an exception that might be connected to #78:

Exception in thread Thread-510:
Traceback (most recent call last):
  File ".\threading.py", line 532, in __bootstrap_inner
  File "./xdebug/session.py", line 151, in run
  File "./xdebug/session.py", line 335, in init
  File "./xdebug/protocol.py", line 188, in read
  File "<string>", line 84, in XML
RuntimeError: cannot load dispatch table from pyexpat
martomo commented 10 years ago

@HoffmannP Please include other information as described in the README.

HoffmannP commented 10 years ago

OS

Linux 3.11.0-20-generic #35-Ubuntu SMP 2014 x86_64 x86_64 x86_64 GNU/Linux

Installed via PackageControl Error occures both ways (remotly & localy)

xdebug.ini

zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.max_nesting_level = 250
xdebug.remote_enable=1
xdebug.remote_log="/var/log/xdebug/xdebug.log"
xdebug.remote_connect_back=1

default sublime settings as installed, no user settings

my sublime uses

>>> sys.version_info
(2, 6, 6, 'final', 0)

If I use the python localy installed the lines

>>> data
'<?xml version="1.0" encoding="iso-8859-1"?>\n<init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///XXXXX/XXXX.php" language="PHP" protocol_version="1.0" appid="25802" idekey="sublime.xdebug"><engine version="2.2.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>'
>>> from xml.etree import cElementTree as ET
>>> document = ET.fromstring(data)

work. If I do the same in the sublime command line it fails. I let the script print the value for data to test for which xml it failed.

martomo commented 10 years ago

It seems that you are missing some python modules, you can specify a different python installation by configuring python_path.

For example "python_path" : "/usr/lib/python2.7".

HoffmannP commented 10 years ago

I found the solution: You have to download python2.6-stdlib (python2.7 is not working because the pyexpat-binary was compiled for another python version) and copy the /usr/lib/python2.6 directory into $sublime/lib/ so that $sublime/lib/python2.6/lib-dynload/pyexpat.so is found…

martomo commented 10 years ago

Or you could specify /usr/lib/python2.6 as python_path in your configuration. This way the problem will appear again once you update or reinstall Sublime Text application, while the Xdebug.sublime-settings should be stored in in your user directory.

FatBoyXPC commented 9 years ago

@martomo I'm still having the same issues as the @HoffmannP. I'm having trouble finding a python2.6 with a lib-dynload directory that has pyexpat.so. The strange thing is, /usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so exists.

Ubuntu 14.04 sys.version_info: (2, 6, 6, 'final', 0) Installed Xdebug Client via package control Xdebug Version: 2.2.3 Running script through browser xdebug config same as above xdebug settings in sublime are default, with the url mapping ot my project's url.

Error: Exception in thread Thread-26: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File "./xdebug/session.py", line 151, in run File "./xdebug/session.py", line 335, in init File "./xdebug/protocol.py", line 191, in read File "", line 84, in XML RuntimeError: cannot load dispatch table from pyexpat

rustjson commented 9 years ago

@FatBoyXPC Did you fixed it ? I have the same problem.

FatBoyXPC commented 9 years ago

@RustJason I just ended up using ST3 :P

rustjson commented 9 years ago

@FatBoyXPC Thanks.