Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » How to get eclipse with xdebug running?
How to get eclipse with xdebug running? [message #1859262] Wed, 24 May 2023 17:10 Go to next message
Rhavin Grobert is currently offline Rhavin GrobertFriend
Messages: 1
Registered: May 2023
Junior Member
Can someone please post a step-by-step walk-thru how you setup eclipse with xdebug on linux to get to the point where you can step-debug a simple file?

I already installed the 2023-03 (4.27.0) version of Eclipse and have xDebug 3.1.2; my PHP is Version 8.1.2-1ubuntu2.11.

I created a simple file:

<?php
$inipath = php_ini_loaded_file();
if ($inipath)
  echo 'Loaded php.ini: '.$inipath.'<br/>';
else
  echo 'A php.ini file is not loaded<br/>';

  echo "<br/>before<br/>";
phpinfo();
echo "<br/>after<br/>";
?>


I can start the built-in server in run-mode and have my script executed at localhost. The first line printed is "Loaded php.ini: /etc/php/8.1/cli/php.ini", so that is not the php.ini specified in the /Servers/PHP Built-in Server at localhost-config/php.ini - branch of my project.

Xdebug is listed, so it at least got installed.

I also cant debug, any attempt to start this server in debug-mode yields strange error messages like this one:

_____
An internal error occurred during: "Creating console for /usr/bin/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/php (24.05.2023, 19:07:19)".
class org.eclipse.debug.core.model.RuntimeProcess cannot be cast to class org.eclipse.php.internal.debug.core.launching.PHPProcess (org.eclipse.debug.core.model.RuntimeProcess is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @40b54762; org.eclipse.php.internal.debug.core.launching.PHPProcess is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @3ec9822c)
_____

Can someone please tell me what is going on here? I had absolutely no luck googling for those strage error messages, that all relate to somehow eclipse not being able to create a console. There are lots of hits but none that vaguely seem to fit.
Re: How to get eclipse with xdebug running? [message #1859780 is a reply to message #1859262] Tue, 27 June 2023 07:26 Go to previous messageGo to next message
Kabiru Usman is currently offline Kabiru UsmanFriend
Messages: 42
Registered: April 2023
Member
It looks like it's a class casting error, implying that Eclipse might be attempting to use the wrong type of Process class for PHP debugging.

I recommend checking the version of your PHP Development Tools (PDT) and ensuring it's compatible with your Eclipse version. Also, make sure that your Eclipse project is set up to use the correct PHP executable and that the PHP executable points to the correct php.ini file with xdebug properly installed and configured.

The error message suggests that the PHP executable might be pointing to /usr/bin/X11/X11/X11/.../php instead of the correct path, which might be something like /usr/bin/php. I suggest verifying this in the debug configurations of your Eclipse project.

It's also possible that there might be conflicts with other installed plugins, so you might want to try disabling non-essential ones and see if the issue persists.
Re: How to get eclipse with xdebug running? [message #1862458 is a reply to message #1859780] Wed, 06 December 2023 08:10 Go to previous message
Elaine Solomon is currently offline Elaine SolomonFriend
Messages: 1
Registered: December 2023
Junior Member
You can try temporarily disabling any PHP extensions you have installed other than xdebug. Restart Eclipse and try debugging again.
Previous Topic:Checking PHP code for vulnerabilities
Next Topic:Auth Fail while synchronizing after Eclipse update
Goto Forum:
  


Current Time: Wed May 01 23:53:08 GMT 2024

Powered by FUDForum. Page generated in 0.03749 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top