SublimeXdebug
SublimeXdebug copied to clipboard
Can't get plugin working on Ubuntu 12.04
I downloaded python2.6_2.6.5-1ubuntu6_i386.deb
, extracted it, and copied usr/lib/python2.6
folder to {Sublime Text directory}/lib
(I also removed original python26.zip
file from the lib folder).
But apparently sublime can't work with that python, because I'm constantly getting errors in the console like this one
AttributeError: 'module' object has no attribute 'on_activated'
With original python I was getting this exception:
Exception in thread Thread-11:
Traceback (most recent call last):
File ".\threading.py", line 532, in __bootstrap_inner
File ".\threading.py", line 484, in run
File "./Xdebug.py", line 321, in thread_callback
File "./Xdebug.py", line 137, in accept
ProtocolConnectionException
Looking for any help on this.
I'm on Ubuntu 12.04 too. I think the python26.zip file is used by Sublime Text 2, so you shouldn't delete it. I did the same thing and I couldn't locate the Package Manager (with Ctrl-Shift-p)...maybe it's used by the package manager.
I followed the Ubuntu 12.04 instructions at the bottom of the README, but when I try to debug, the "footer windows" remain empty (even though the status bar notifies me that "Xdebug: connected")
Did you figure it out?
Did you figure it out?
No. I still have no luck on making this plugin work.
@timborden: I am having the same problem. The status bar says "Xdebug: connected," but the footer windows remain empty. The title bars on the footer windows are also empty.
I installed sublime via the ubuntu repo, and pasted python2.6 into /usr/lib/sublime-text-2/lib/python2.6, such that /usr/lib/sublime-text-2/lib/python2.6/usr/bin/pydoc2.6 exists.
I just get Xdebug: Not Running - according to phpinfo() xdebug is setup correctly I also installed sublime text from ubuntu repo - it works fine - I see no errors
I tried to put the unziped python2.6 files in with /usr/lib/sublime-text-2/lib but that seems to do nothing - not sure why we need to duplicate what is in the zip file? When I get this to work I will be happy to pay for sublime_text ;-)
I just got this running. Follow the instructions in the readme. Inside the python2.6 folder after extraction is usr. Now, go to lib and mv the python2.6 folder from here into sublime/lib. Restart sublime.
Easy peasy. Works great with Chrome and Xdebug helper :).
Ahhhh....I didn't realize that there are two python2.6 folders. There is the parent folder when the deb is extracted, which I had moved into the sublime lib directory....and that didn't work. I needed to move the subdirectory of the extracted to sublime lib. This worked for me:
$ dpkg-deb -x python2.6_2.6.5-1ubuntu6_amd64.deb python2.6
$ cp -r python2.6/usr/lib/python2.6 /usr/lib/sublime-text-2/lib
Yep. This .deb file mimics the filesystem, which makes sense since it's for a system-wide install of python which includes the interpreter, includes, python libs, etc...
So, just in case some people are like me and have local install of sublime(or can't understand my crazy rambling in my OP):
The gist of the internal directory structure of the python2.6_2.6.5-1ubuntu6_amd64.deb package is:
python2.6_2.6.5-1ubuntu6_amd64.deb |- python2.6/ -|- usr/ --|- bin/ --|- include/ --|- lib/ ---|- python2.6/ --|- share/
And, what you need for this plugin is python2.6_2.6.5-1ubuntu6_amd64.deb/python2.6/lib/python2.6.
So, for me on a local install of sublime:
~$ dpkg-deb -x python2.6_2.6.5-1ubuntu6_amd64.deb ~/python2.6 ~$ mv ~/python2.6/usr/lib/python2.6 ~/sublime/lib ~$ rm -r ~/python2.6
Since we have a more recent release of python, no need to keep it. Just need the lib.
The minimum files/dir the sublime/lib directory should have for this plugin are:
python2.6/ python26.zip
Hopefully that's a bit clearer for anyone who might pass by.
@gornostal I don't know whether any of those comments helped you, but neither of them helped me, that's for sure. So I had to figure it out on my own and here is the corollary:
There are two types of problems. First is manifesting itself with "pyexpat" in the console view of Sublime Text and the second by "ProtocolConnectionException". @gornostal was asking about "ProtocolConnectionException" but all the answers he got were on the "pyexpat" problem instead.
"pyexpat" problem
The "pyexpat" problem, however, is totally real and needs to be addressed, which I'm going to do just to make this answer complete. In my case, which is Ubuntu 12.04, I fixed it with the following steps:
- Download
python2.6_2.6.5-1ubuntu6.1_amd64.deb
from here - Unpack the package with command:
dpkg-deb -x python2.6_2.6.5-1ubuntu6.1_amd64.deb python2.6
- Make sure that
/usr/lib/sublime-text-2/lib
exists - Copy a subfolder with command:
sudo cp -r python2.6/usr/lib/python2.6 /usr/lib/sublime-text-2/lib
- Remove no longer needed
.deb
file andpython2.6
folder
"ProtocolConnectionException" problem
The cause of the problem most likely is a port conflict. The FastCGI PHP server (PHP-FPM) listens on port 9000 by default and so does SublimeXdebug. And if PHP-FPM and Sublime Text run on the same machine, SublimeXdebug fails to start listening on port 9000 because it's already attached to PHP-FPM. The most straightforward way out is to change the Xdebug port to, for example, 8999:
- Open
/etc/php5/conf.d/xdebug.ini
in an editor and modify it to make it contain:xdebug.remote_port = 8999
- Open
~/.config/sublime-text-2/Packages/Xdebug/Xdebug.sublime-settings
and make it contain:"port": 8999
- Restart PHP-FPM server with command:
sudo service php5-fpm restart
- Close and open Sublime Text.
After that, SublimeXdebug should become functional.
Look for more information if you don't know how to initiate an Xdebug session, which can be tricky in some cases. Before getting into actual debugging or SublimeXdebug plugin testing, take a look at this section of the official SublimeXdebug page or at these Firefox addons. Remember that Sublime Text expects Xdebug IDE key to be sublime.xdebug
Thanks for answer about "ProtocolConnectionException" problem. But after that I have another:
Traceback (most recent call last):
File "./Xdebug.py", line 327, in gui_callback
File "./Xdebug.py", line 97, in read
File ".\xml\dom\minidom.py", line 1927, in parseString
File ".\xml\dom\expatbuilder.py", line 32, in
Does anyone else encountered a similar problem?
@DmitryMironenko Did you try the solution of @hesmond-hume for the "pyexpat"-problem? This is what fixed the exact same error for me. This should be a 32 bit/ 64 bit operating system problem, right? Are you using 64-bit Ubuntu?
@DerTee Thanks. The problem was when I use python2.6_2.6.5-1ubuntu6_i386.deb, but I have 64-bit AMD.