We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27519
    • 275 Posts
    In an effort to boost my PHP productivity, I’m trying to get Netbeans into debugging mode on my local MODx development site to debug the PHP side of my CMP’s.

    Unfortunately without success.

    I have XDebug up and running according to PhpInfo (which was a royal pain in itself to get it properly configured).

    When I try to debug with NetBeans, it’s either two of the following scenarios:

    - I choose "Debug File" to debug a certain PHP file, a processor from my CMP. What happens is that Netbeans tries to open that specific file in the browser. This is not going to work as it bypasses all initialisation and it also appends something to the URL to establish the debugger session. Effectively my browser signals that the link could not be resolved and Netbeans keeps waiting forever to establish a debugging session.

    - I choose "Debug Project". Again Netbeans tries to open a browser page on the following url: http://localhost:8888/modx/manager/index.php?XDEBUG_SESSION_START=netbeans-xdebug. In this scenario, the browser keeps waiting for localhost forever without a page showing up while Netbeans shows that a debug session is running.

    I use OS/X Snow Leopard, MAMP, Chrome and Netbeans 6.9.1...

    Any fellow Netbeans users with ideas on how to get this running properly?
      MODx Revolution / MAMP / OS X
      • 22303 MODX Staff
      • 10,725 Posts
      I quit using NetBeans, but PhpStorm’s remote debugging with XDebug worked for me with no problems first try. Im going to post more information on debugging with Revolution and PhpStorm this weekend, and maybe I can power up NetBeans and give it a whirl...
        • 27519
        • 275 Posts
        That would be great.

        Tried PHPStorm but was put off by it. Can’t remember why.... huh
          MODx Revolution / MAMP / OS X
          • 3749
          • 24,544 Posts
          I’d like to see that. I can’t get debugging to work at all in PhpStorm or NetBeans, though it works fine in PhpED.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 27519
            • 275 Posts
            @Bob Ray: does PhpEd use XDebug as well or does it have its own debugger?
              MODx Revolution / MAMP / OS X
              • 26903
              • 1,336 Posts
              You can tell netbeans to not open a browser page for every debug session, I always use it this way, unfortunately it seems to default to doing this.

              Go to ’properties’ from the pull down menu on your project, select ’run configuration’ and press the ’advanced’ button, click the radio box that says ’do not open web browser’, job done
                Use MODx, or the cat gets it!
                • 3749
                • 24,544 Posts
                Quote from: skndn60 at Oct 30, 2010, 03:10 AM

                @Bob Ray: does PhpEd use XDebug as well or does it have its own debugger?

                PhpED has its own debugger, but I’ve enabled xDebug in various ways as per instructions for the other editors.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quite frankly I decided I wasn’t going to use Java-based IDE’s anymore after recent Eclipse and NetBeans experiences. But PhpStorm coming out has changed my mind and already increased my productivity immensely. I’d be curious to hear others note why they don’t like PhpStorm, for contrast. I have yet to find any other IDE that has the "refactoring" features that JetBrains started adding to their flagship Java IDE back around 2000 and to have that for PHP/HTML/JS/CSS is simply the bees knees IMO. Not to mention the stability compared to Eclipse or NetBeans; not even in the same league.

                  Not sure why everyone has so much trouble with XDebug. I use MacPorts and always have the latest, and it just works. I didn’t have to do anything special to get it working in PhpStorm either.
                    • 27519
                    • 275 Posts
                    Quote from: shamblett at Oct 30, 2010, 04:27 AM

                    You can tell netbeans to not open a browser page for every debug session, I always use it this way, unfortunately it seems to default to doing this.

                    Right, thanks. That fixed that problem.

                    Now it appears that phpInfo shows XDebug but php -m in terminal doesn’t and NetBeans is still not connecting.

                    I’ve been reading a LOT of installation woes with XDebug for OS X.

                    See if I can get some improvements with MacPorts...
                      MODx Revolution / MAMP / OS X
                      • 27519
                      • 275 Posts
                      I updated my MAMP installation to the latest and the greatest.

                      I know XDEBUG is running properly now: I see its footprint in PHP Info and it shows up as a running module when I do php -m at the command line.

                      Still, NetBeans refuses to set up a debugging session and keeps waiting for a connection.

                      I think I read all posts on the planet about the topic and I’m about to give up on this.

                      Any more thoughts before I switch to EDLIN for development .... huh?
                        MODx Revolution / MAMP / OS X