views:

1202

answers:

4

Hi everyone, I'm having trouble with debugging a PHP project through NetBeans using XDebug, and was hoping someone out there might have had this problem before.

Debugging works fine for the requested php file - so if I go to index.php on the remote server, I can put a breakpoint anywhere in index.php in NetBeans and the code stops there and I can step through.

The trouble is, all the other files appear on the call stack like this: "file:///home/user/site_html/library/class.requestprocessor.php" and because that's a path to a file on the remote server, NetBeans is unable to resolve the name, and so I can't step through the code for it. It makes debugging practically useless! The php file that was requested, for example index.php, appears just as "index.php", it's just all the other ones which are included that NetBeans can't resolve properly.

Is there some setting in NetBeans or XDebug that I can use to solve this problem? I have tried my best looking through all the project settings and options in NetBeans, and also looked through all the configuration options of the XDebug extention, but to no avail. Surely someone out there must have had this problem before? How did you solve it? I'll be very grateful if you could let me know.


If there's no other way, do users of Eclipse PDT and XDebug have this problem when debugging on a remote server? If not I'll make the switch.

A: 

Okay it seems no one is going to answer the question, so I'll post the results of my research.

As I was unable to find a way to make NetBeans successfully debug as I wanted, I tried using Eclipse PDT and Visual Studio 2008 with the VS.php extension in order to solve my problem. Eclipse PDT was hell to setup, and I wasn't happy with the way you couldn't specify a port to use for your FTP server in its Remote Server Explorer. I found VS.php did everything I wanted, it automatically uploads the code, as well as having perfect debugging, and it was EASY to setup. The only thing is, it looks ugly and I can't find a way to customise its colours. However, I'm going to choose function over fashion, and so I've settled on using VS.php as my final solution. Which to be honest is a shame, NetBeans was really great, I just can't live without a working debugger.

Ray Hidayat
+1  A: 

This issue appears to be fixed in NetBeans 6.7.

Travis Beale
That's right, that's what I'm using now
Ray Hidayat
A: 

I had this same issue. I'm running Netbeans 6.8. You have to right click on your project, go to project properties/run configuration/advanced and set up path mapping. Map the folder on the server to a folder locally so that Netbeans knows which files to open locally when it hits these methods.

Sean