A few years ago I found a way to do remote debugging with Komodo and XDebug. However, my latest efforts to repeat that have been futile.

I decided to go down a different route this time and try it with EasyEclipse for PHP. NOTE: for this entry I am using WAMP5 on my local machine.
Here is what I did.

  1. Install EasyEclipse for PHP (Link)
  2. Download the DBG Archive and unpack it. Place the dll-x.x.x file (renamed to just .dll) into your php directory where all the other ext DLLs are located – just match the dll file up with the PHP version you have. (Note: you probably just need the dbg modules rather than the listener).
  3. Enable the debugger in your PHP.ini file by doing the following
    1. [debugger]
      debugger.enabled = true
      debugger.profiler_enabled = true
      debugger.JIT_host = clienthost
      debugger.JIT_port = 7869
  4. Check for the debugger by going to your phpinfo() and seeing if the “with DBG v2.15.5, (c) etc by Dmitri Dmitrienko” line is there (or some variation thereof).
  5. Next get the PHP Eclipse plugin for EasyEclipse.
  6. One installed, you will want to configure PHP Eclipse for your Environment
    1. Window->Preferences
    2. PHPeclipse Web Development->PHP External Tools
      1. Setup the PHP command path and parser command
    3. PHPeclipse Web Development->PHP External Tools->Apache
      1. Setup the current paths to Apache, the httpd.conf file, and your etc/hosts file
    4. PHPeclipse Web Development->PHP External Tools->MySQL
      1. Setup the current paths to MySQL
    5. PHPeclipse Web Development->Project Defaults
      1. Setup up your default Localhost and Document Root
  7. Now create a PHP Project in Eclipse
    1. File->New->Project…
    2. Select PHP->PHP Project
    3. Give it a name
    4. Uncheck the Use default location and place your document root in there
    5. Click Finish
    6. Create an index.php file if one does not already exist
    7. Populate the file with the following code:
      1. print(”How are you doing”);
        print(”I am Fine”);
        debugBreak();
        print(”Thanks for Asking”);
        print(”Anytime”);
        print(”BYE!”);
    8. Create a debug running instance
      1. Run->Debug…
      2. Click on the Arguments tab
        1. Uncheck “Use default working directory” and replace the working directory with your DocumentRoot
      3. Click on the Environment Tab
        1. Select the correct path to your PHP interpreter
        2. On the Remote Debug subtab check “Remote Debug” and “Open with dBGSesssion URL in internal browser”
        3. Set your correct sourcepath
        4. Set your mapped paths. (eg. Local: c:wampwwwindex.php Remote: http://local.localhost.com/index.php)
      4. Click Apply and the Debug
      5. You should now be able to step into your script. It should break where you entered the “debugBreak()” call.

NOTE:  You can also hit breakpoints through any browser, if you include the following request string:

  • ?DBGSESSID=1@clienthost:10001