1
votes

i have a problem regarding netbeans in combination with xdebug on a remote machine.

Installation

My php.ini looks like this one(accepted answer) Remote PHP Debugging with Netbeans and XDebug

And everything works pretty normal. Simple projects I can debug on on the remote-server 9000. I also can use the debug-button on netbeans.

The problem

As long as the the entry file is inside the project everything works fine. The problem starts when the file is outside the project scope. Imagine a project called Calculator. But the files get never called directly, they get included by an index-file outside the current project.

So the project(in netbeans) looks like this

  • Calculator
    • file1.php
    • file2.php

The real file structure looks like this as an example

  • index.php
    • Calculator
      • file1.php
      • file2.php

Solution?

The index.php gets called via debugger. The debug waits somewhere in that index.php (I can see this at the "call stack") if I checked "stop on start" in the project properties. Even if the index-file includes file1.php I cannot get to a breakpoint. It runs through till the end. breakpoints are ignored.

A solution was to put the project at the root-level(including the index.php) but this is in that case not acceptable. Has anyone an idea what I could do to get this working?

Thanks in advance!

1
As far as I know, this is a limitation in Netbeans which refuses to do anything if the files are not in the project scope. I would suggest you file a bug with them. - Derick
Ok. I immediately stopped working on netbeans and configured the same scenario in eclipse. Eclipse does not have a problem configuring path params(server to workspace) and everything works fine. If there is also a solution for netbeans, please let me know. Cheers - whereismydipp

1 Answers

1
votes

This is an old post but you always can extend NetBeans outside of project definitions. Go to Project->Properties->Include Path and add your external directories. They should resolve not only in xdebug but any Namespaces & classes etc. Can be read by code complete.