0

I am trying to get either NetBeans or Komodo IDE to remotely debug PHP. I have a remote website installed on the development machine which is a Mac running Mountain Lion. Xdebug is installed. The website on the local machine runs normally in a browser.

However, for both NetBeans and Komodo IDE, when single stepping through the code, the attempt to execute mysqli_connect fails. In NetBeans there is the following error message:

Socket Exception occured If you have any Watches, try to remove them and restart debugger. If removing Watches does not help or you don't have any Watches, please file an issue and provide the exact steps to reproduce your problem. Please attach the IDE log. Attaching your project would also be very helpful.

I have seen other people reporting this error message, but no help has been provided.

In Komodo IDE, the failure occurs at the same location, but there is no error information provided at all.

The funny thing in NetBeans is that after some single stepping through the first page of the site, if I then run the code from that point, it executes without failure and the web page is displayed in the browser! This means that the problem only occurs while single stepping.

I have seen something somewhere about a bug in NetBeans. But it seems pretty blatant that NetBeans should not be able to single step through code that tries to connect to mysql. Rather I am thinking it would be some configuration issue on my system.

Komodo IDE has the same failure whether single stepping or running any other way. It just does not get past that point.

However, please keep in mind that just running the site in a browser works fine. So what is missing that prevents the Xdebug single stepping from connecting to mysql?

** Additional information **

I have found two instances of xdebug.so on my system.

-rwxr-xr-x  1 root  admin  274508 Oct  6  2011 /opt/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
-rwxr-xr-x  1 root  wheel  202672 Sep 20 20:01 /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so

Also, there is an /opt/local/var/db/php5/xdebug.ini which references the xdebug.so in the /opt/local path. The xdebug.so in the /usr/lib path is the one that I thought was in use and which corresponds to instructions as to where it should be installed.

These are apparently two different versions of xdebug.so. Could that be related to my problem?

Jeffrey Simon
  • 918
  • 3
  • 11
  • 25
  • What is your xdebug log in komodo ide for example? Can you post your xdebug settings? – Micromega Nov 10 '12 at 19:09
  • What is your xdebug log and xdebug settings? Why is there different version? The version number of the folder is the same? – Micromega Nov 10 '12 at 19:23
  • Where do I find the xdebug settings? – Jeffrey Simon Nov 12 '12 at 16:52
  • I have no idea why there are two versions in different locations. They are definitely different files as seen by their sizes. Here is a theory on why there are two: (1) OS X includes xdebug.so (I have send that somewhere). That would be the /opt/local version. (2) I installed the other one when trying to set up xdebug long ago. Please note: this is my theory, and not proven. – Jeffrey Simon Nov 12 '12 at 16:54
  • You find xdebug settings in php.ini. Best bet is to compile it from newest version. – Micromega Nov 12 '12 at 17:08
  • That's what I was thinking; the xdebug settings in php.ini. However, as stated in my comment below, upgrading xdebug to 2.2.0-komodo has solved the problem. – Jeffrey Simon Nov 13 '12 at 14:56

1 Answers1

2

You need to make sure that you are running one version of Xdebug - and also make sure that this is the latest version (2.2.1 at the moment). If you can still reproduce this issue, please file a bug report at http://bugs.xdebug.org with a short sample script (that contains all the code + data!) and a remote debugging log for a debugging session using that script (see http://xdebug.org/docs/all_settings#remote_log on how to make such a log).

Derick
  • 35,169
  • 5
  • 76
  • 99
  • I arranged to use each of the instances of xdebug. Turns out the one that I believed came with OS X was 2.1.2 and the one that I installed was 2.1.3. That latter version I obtained from ActiveState and I am wanting to use it with Komodo, so I would think that version should work. I will set up the remote_log in a bit and see what that provides. – Jeffrey Simon Nov 12 '12 at 17:47
  • I tried getting a newer version of xdebug, but it appears to get the very latest version I have to build it myself. The build instructions I have found so far do not work on OS X. I found some, but XCode is apparently needed to provide the c compiler. In any case, I went back to the ActiveState website and downloaded the version they now have which is a bump from what I just got a short time ago. Putting that in place and running phpinfo shows that it is 2.2.0-komodo. I am thinking that should work and will post an update shortly. – Jeffrey Simon Nov 13 '12 at 02:46
  • Hooray! With 2.2.0-komodo, single step debugging now executes the mysqli_connect statement properly. Not only that, remote debugging in NetBeans is working too. So I may mark this as the accepted answer, except for the fact that I did not need xdebug 2.2.1, but that xdebug 2.2.0-komodo was adequate. – Jeffrey Simon Nov 13 '12 at 02:59