oshirowanen
oshirowanen

Reputation: 15925

Having difficulty configuring php debugging using netbeans

UPDATE 2:

Nevermind, figured it out, in netbeans I had an extra ) in tools > options > general > web browser > edit > arguments was -remote {url}), so I changed it to -remote {url}.

I now have netbeans debugging php on my new laptop.

UPDATE 1:

I've been comparing my old laptop with my new laptop as debugging works on my old laptop. The only difference I have seen is the url in the browser when I click debug.

Old laptop: http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug

New laptop: http://localhost/PhpProject1/index.php?XDEBUG_SESSION_START=netbeans-xdebug)

When I remove the ending ) from the new laptop url manually, debugging starts to work... Why does the new laptop setup have an ')' at the end and the old setup doesn't?

ORIGINAL QUESTION:

I'm trying to configure xdebug for php debugging via netbeans on a localhost. I have tried following a couple of guides, but can't seem to get it to work. I've had it configured on an old laptop, but can't seem to remember how. At the moment, when I add a breakpoint and click "debug project", it opens up a browser and displays waiting for connection (netbeans-xdebug). The "step over" and "step into" options are disabled.

How do I resolve this issue?

I have done the following so far:

I have installed lamp, php5-xdebug, and the php plugin for netbeans.

I have the following in /etc/php5/apache2/conf.d/xdebug.ini:

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=On
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_enable=1

I have done service apache2 restart.

I can see that xdebug is enabled with phpinfo();

In netbeans - tools > options > php, I have done the following:

PHP 5 Interpreter = /usr/bin/php
Bebugger Port = 9000
Session ID = netbeans-xdebug

Upvotes: 0

Views: 2734

Answers (2)

oshirowanen
oshirowanen

Reputation: 15925

The solution to the problem can be seen in update 2 in the original question, which is:

In netbeans I had an extra ) in tools > options > general > web browser > edit > arguments was -remote {url}), so I changed it to -remote {url}.

Upvotes: 0

Eelke
Eelke

Reputation: 21993

Sounds like netbeans is waiting for php to callback. Did you add xdebug to php?

For more info see this article

Upvotes: 1

Related Questions