here is a demo video:
the possibility to step (!) debug requests, as they appear on the server is a neat feature, xdebug + eclipse are a great team, when the setup is complete.
- installed GNU Linux Debian 11 (+ install it with the “Keep It Simple” (K.I.S.S ) MATE Desktop 🙂
- installed apache2 + php8.1 (LAMP webserver stack)
- download & run the setup.tar.gz of eclipse pdt (the PHP version of Eclipse)
- how to installed xdebug & connect it with Eclipse, follow those instructions:
- and as usually, xdebug + eclipse do not like to cooperate out of the box, why?
- (result is the “classic” eclipse hanging on progress” “of 75%” (or some other %) when trying to start a debug session“, so also here more accurate error messages would have helped the developer debug the problem like after a 30sec timeout “xdebug did not connect within 30 sec to port 9000, wrong port?”)
- because they could not agree on what port to use per default
- latest eclipse wants to connect to xdebug per default on port 9000
- latest xdebug wants to connect to eclipse per default on por 9003
- c’mon, get in contact with each other and set a standard 🙂
- (this has cost me about 2h of debugging around eclipse and ini files)
- below (older) guide is still usable:
-
-
php -v; # is also a good way to test if xdebug is loaded when php is started vim /etc/php/8.1/apache2/php.ini; # no xdebug related settings are here vim /etc/php/8.1/cli/conf.d/20-xdebug.ini; # they are all here and read like: [XDebug] zend_extension=xdebug.so xdebug.mode=debug xdebug.start_with_request=trigger xdebug.start_with_request = 1 xdebug.remote_autostart = on xdebug.log_level = 7 xdebug.profiler_enable_trigger = 1 xdebug.profiler_enable = 0 xdebug.remote_enable = 1 xdebug.profiler_output_dir = "/tmp" systemctl restart apache; # changes need to be made active by restarting webserver
-
- when everything is installed go to eclipse -> window -> preferences
- if the developer r-click in the empty white space next to the code ->
- sees this message…
download the results:
- install https://www.virtualbox.org/ (available for GNU Linux, OSX, Windows)
- wget https://dwaves.de/downloads/devPHP_Debian_11_XDebug+Eclipse_php8.1_usr_root_pwd_root.tar.xz.sha512sum.txt
- (3.2Gbytes) wget https://dwaves.de/downloads/devPHP_Debian_11_XDebug+Eclipse_php8.1_usr_root_pwd_root.tar.xz
- sha512sum -c devPHP_Debian_11_XDebug+Eclipse_php8.1_usr_root_pwd_root.tar.xz.sha512sum.txt
- checksum ok? -> continue otherwise: redownload
- unpack tar fcvJ devPHP_Debian_11_XDebug+Eclipse_php8.1_usr_root_pwd_root.tar.xz
- doule click the vbox file
- usr: user pwd: user, usr: root pwd: root (change both as soon as possible!)
- start the vm 🙂
by the way:
what is btw excellent done is this “Open Source project funding and progress status page”:
so every user can see, what is the progress “where is it hanging” of the software project, is it a lack of funding?
suggestion: what still missing a “still todo” todo list, where user’s can post suggestions and vote on features 🙂
from user to dev:
- the positive:
- php is easy to learn
- php is usually “fast enough” (for web backends: it is slower than java but faster than python, but java needs A LOT more RAM)
- the critique:
- php related environments might be a wee bit complicated to setup
- if the user wants to become a php dev check out bro’s excellent fun and easy php examples 🙂
- just4info:
- all those fancy php frameworks symphony sometime consisting of more than 10.000 files (thanks for making it open source but that’s a wee bit against unix kiss)
- are just libraries that a dev wrote to use it, and while it HIGHLY might advance the user-soon-php-dev php-related-career they are NOT REQUIRED to get started, also:
- if the user-soon-php-dev writes libraries + uses xdebug, the user-soon-php-dev is the only one who REALLY understands whats going on “under the hood” why things work or fail
- just4info:
keep it up and running:
- please consider
- support the excellent xdebug project that makes server side PHP debugging a mild summer breeze
- donating the great IDE with the superb team-compare-two-files-diff-view but massively-overcomplicated-menu-structure (too complex menus X-D) eclipse project
liked this article?
- only together we can create a truly free world
- plz support dwaves to keep it up & running!
- (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
- really really hate advertisement
- contribute: whenever a solution was found, blog about it for others to find!
- talk about, recommend & link to this blog and articles
- thanks to all who contribute!