Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Xdebug doesn't work (Debugger PHP)
Xdebug doesn't work [message #1859122] Fri, 12 May 2023 16:05 Go to next message
Gérarrd LE REST is currently offline Gérarrd LE RESTFriend
Messages: 7
Registered: May 2023
Junior Member
Hi,

configuration:
ubuntu 22.04
php 8.1
java 19
eclipse 2023.03

" Debug As PHP CLI" doesn't work. php-xdebug is installed. But the software Eclipse says the opposite.
https://wtf.roflcopter.fr/pics/v1OE1OAF/yKUmEF8e.png
gerard@gerard-ThinkCentre-M700:~$ php -v
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans

[Updated on: Sun, 14 May 2023 19:52]

Report message to a moderator

Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1859128 is a reply to message #1859122] Sat, 13 May 2023 17:26 Go to previous messageGo to next message
Gérarrd LE REST is currently offline Gérarrd LE RESTFriend
Messages: 7
Registered: May 2023
Junior Member
I tried this solution: https://roelofjanelsinga.com/articles/how-to-enable-step-debugging-php-xdebug-phpstorm/

this is my file /etc/php/8.1/cli/conf.d/20-xdebug.ini :
zend_extension=xdebug.so
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.client_host=127.0.0.1
xdebug.mode=debug
xdebug.idekey=ECLIPSE


the configuration table of xdebug is strange ((setting renamed in Xdebug 3)

https://wtf.roflcopter.fr/pics/s7AxLV5T/VrNZJoYh.png


[Updated on: Sun, 14 May 2023 22:14]

Report message to a moderator

Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1859136 is a reply to message #1859128] Sun, 14 May 2023 22:16 Go to previous messageGo to next message
Gérarrd LE REST is currently offline Gérarrd LE RESTFriend
Messages: 7
Registered: May 2023
Junior Member
I have forgot to give my configuration:
- ubuntu 22.04
and for php and Xdebug:
erard@gerard-ThinkCentre-M700:~$ php -v
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1860270 is a reply to message #1859136] Wed, 26 July 2023 10:10 Go to previous messageGo to next message
Philippe Debrabant is currently offline Philippe DebrabantFriend
Messages: 3
Registered: July 2023
Junior Member
Hi,
Do you have found a solution ?

On my side, my configuration is :
- Linux Mint 21.2 Cinnamon
- Eclipse 2023-06
- PHP Development Tools (PDT) Zend and Xdebug Profiler Support 8.0.0.202306050832
- PHP 8.1 with Xdebug :
PHP 8.1.2-1ubuntu2.13 (cli) (built: Jun 28 2023 14:01:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.13, Copyright (c), by Zend Technologies
    with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans


For now, I only need to run PHP CLI only. So I configure my xdebug.ini with this content :
zend_extension=xdebug
xdebug.mode=debug
xdebug.start_with_request=yes


In the Eclipse's PHP executable configuration, I noticed that when I select the /usr/bin/php8.1 file, its path is replaced with "/run/user/1000/doc/3b978223/php8.1". For Xdebug, I use the 9003 port as it's the actual port for V3.x versions.

If I omit the last line (xdebug.start_with_request), Eclipse don't stop on the first line or any line with a breakpoint. If I active the xdebug logging, Xdebug says that it don't find the XDEBUG_SESSION environment variable definition, so it don't start. If I export this variable in the terminal and run my script in this terminal, the IDE connects and stop on the first line. I added this environment variable in the "Debug Configuration" of my script, but there's no effect. If I display the list of environment variables with
print_r(getenv(NULL));

XDEBUG_SESSION is not showed (Eclipse's bug ?).

With "xdebug.start_with_request" I can run the debugger in Eclipse, BUT the debugger starts also when I ask to run the program normally (without the debugger).

I have an older Linux Mint partition on my desktop (20.3) with Eclipse 2022-xx, PHP 7.4.x and the corresponding Xdebug version. No problem to debug and no need to configure "xdebug.start_with_request=yes" in the xdebug.ini file.
Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1860390 is a reply to message #1860270] Wed, 02 August 2023 20:16 Go to previous messageGo to next message
Ngan Nguyen is currently offline Ngan NguyenFriend
Messages: 1
Registered: August 2023
Junior Member
Got this fixed by "Use system default php.ini configuration" in "Edit PHP Executable". Then have only 2 lines:
zend_extension=xdebug
xdebug.mode=debug

in xdebug.ini

[Updated on: Thu, 03 August 2023 17:58]

Report message to a moderator

Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1867266 is a reply to message #1860390] Thu, 20 June 2024 09:29 Go to previous messageGo to next message
wadu nade is currently offline wadu nadeFriend
Messages: 1
Registered: June 2024
Junior Member
Why does Eclipse on my new Linux Mint setup require "xdebug.start_with_request=yes" for Xdebug to work, causing it to run even when I just want to execute normally? On my older system, Xdebug works fine without this setting. Could this be a bug in Eclipse, or maybe even related to settings affecting XDEBUG_SESSION visibility?

[Updated on: Wed, 31 July 2024 01:08] by Moderator

Report message to a moderator

Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1869144 is a reply to message #1867266] Fri, 02 August 2024 17:04 Go to previous messageGo to next message
Philippe Debrabant is currently offline Philippe DebrabantFriend
Messages: 3
Registered: July 2023
Junior Member
How did you installed Eclipse ? Did you used the flatpak package ?
Re: " Debug As PHP CLI" doesn't work (eclipse) [message #1869156 is a reply to message #1869144] Sat, 03 August 2024 09:54 Go to previous message
Yak Maya is currently offline Yak MayaFriend
Messages: 4
Registered: August 2024
Junior Member
I have installed eclipse via download from the site. Then i added the PHP packages via the market place. Then i configured the server from windows-preferences-php-servers. Then i configured the run configuration. Then I configured project-proprerties-php-debug. I think i did not use the flatpak package. Thank you for your time. I have worked 20+(and counting) h to understand this error.
Previous Topic:PHP built in server wrong path and no files
Next Topic:Best lightweight IDE for PHP programming?
Goto Forum:
  


Current Time: Tue Dec 03 21:05:54 GMT 2024

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

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

Back to the top