Eclipse 23.06 Xdebug 3.2.1 ISPConfig3

Discussion in 'Server Operation' started by cjsdfw, Aug 25, 2023.

  1. cjsdfw

    cjsdfw Member

    Really having a hard time setting up Eclipse and XDEBUG after installing a new Ubuntu 22.04 Server with ISPConfig3. I am following the same procedures I followed with my Ubuntu 18.04 server setup but I can not get it to work.

    My objective is to be able to debug remote Wordpress site with Eclipse and Xdebug either making use of Eclipse's SSH tunnel or Putty SSH Tuunel. I also tried debugging the site Port Forwarding 9003 in my router to the WS running Eclipse but always end up with a message in Eclipse "Launching Debug COnfig (72%).

    FOr starters, I use to configure XDEBUG parameters in ISPCOnfig Site Options Tab Custom php.ini settings, but with this server I have to include the Xdebug settings in /etc/php/8.1/fpm/conf.d/20-xdebug.ini or they do not take effect.

    I have posted in Eclipose Forum but still waiting for someone to reply, I guess my question is if someone has gotten this to work in this comunnity that can share some clues?

    I know this is kinf of out of place here but figure I give it a try: I am not making progress resolving it.
    Thanks
     
  2. cjsdfw

    cjsdfw Member

    Welll, it took me along time and many useless approaches but I finally isolated the problem and resolved the issue.
    In case other are interested I am posting my approach and resolution to the issue:
    I wanted to debug through Eclipse intenal SSH Tunnel but I could never get this to work, so I decided to create a Remote Synch Project together with a Tunnel from Putty and that worked except for the aparently random, but not really the case, getting stuck at "Launching Debug Config (72%)".
    My problem turned out to be a long lived tunnel for the XDEBUG 9003 port did not allowed for a new tunnel to be created. The solution is to destroy the long lived tunnel, if one exists, before setting up the putty tunnel.

    So in summary,
    1. Setup a Remote Synch Project
    This will allow you to remote debug the project at the server.

    2. Set up a Debug Configuration
    I won't detail the setup, important aspect is to set the XDEBUG Port to something other than 9000, I used 9003.

    3. Configure xdebug.ini
    Code:
    zend_extension=xdebug.so
    xdebug.mode = debug
    xdebug.client_host = localhost
    xdebug.connect_timeout_ms = 500
    xdebug.log = "/var/www/clients/client4/web6/tmp/xdebug.log"
    xdebug.idekey=ECLIPSE_DBGP
    xdebug.log_level=1
    
    4. Setup the Putty Tunnel but don't start it yet (one time only, if you save the session) :)
    Under Category Session:
    Setup your server's Hostname or IP Address the SSHD port Number.
    Under Category Connection-SSH...
    Auth Credentials -
    Point to your Private Key file
    Tunnels -
    Forward Port R9003 localhost:9003 or wahtever port to choose in step (2).

    5. Check if there is along lived tunnel in existence at your server:
    Code:
    netstat -tulpn | grep LISTEN | grep :9003
    tcp        0      0 127.0.0.1:9003          0.0.0.0:*               LISTEN      32451/sshd: vtm_adm
    tcp6       0      0 ::1:9003
     
    In this case we do have one so we need to destroy it before we setup the tunnel.

    Code:
    fuser -k 9003/tcp
    6.Start the Putty Tunnel

    7.Debug you project :)

    Hope someone finds this usefull.
     
    Last edited: Nov 24, 2023
    michelangelo, ahrasis and till like this.

Share This Page