Two Days trying to get XDebug Working with Komodo 12!

If anyone can help it would be most appreciated. I have read through dozens of articles on this but still cannot get it working. I will provide as many screenshots as possible.

  1. Firstly I have installed xdebug…

  1. Secondly I have configured xdebug to use port 9003

  1. I start PHP and everything works.

  2. I open Komodo Preferences and point app to PHP interpreter and php.ini. Everything seems fine.

  1. I test to make sure Debugger is listening on correct port… All good.

So at this stage I assume I am ready for debugging locally and remotely? I open my index.php file and click the play button inside the Komodo UI…

Screenshot_858

So I think, OK, maybe I will try remote? I open my test site running on localhost using ?XDEBUG_SESSION_START=1 and I get nothing?

This is soo frustrating? Have I missed something? Why is this so hard?

Hi @geegriff,

You’ll need to follow the instructions here to get PHP 7.3 support (or anything later than 7.2):
Can’t get PHP debugging running - Failed to configure for local PHP debugging - Support - Komodo IDE & Edit | Forums

Apologies for the inconvenience and your time wasted.

  • Carey

Installed newer wamp, all my php debug broke. What am I missing. Images below.


4

OK, changing my php.ini folder fixed local debug, but my remote will not work.

So it seems that xdebug.org has changed some of it’s setting names.
The following was in my php error log.

[30-Nov-2022 14:31:19 UTC] Xdebug: [Config] The setting ‘xdebug.remote_enable’ has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
[30-Nov-2022 14:31:19 UTC] Xdebug: [Config] The setting ‘xdebug.remote_host’ has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
[30-Nov-2022 14:31:19 UTC] Xdebug: [Config] The setting ‘xdebug.remote_mode’ has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_mode (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
[30-Nov-2022 14:31:19 UTC] Xdebug: [Config] The setting ‘xdebug.remote_port’ has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
[30-Nov-2022 14:31:19 UTC] PHP Parse error: syntax error, unexpected ‘Failed’ (T_STRING) in C:\wamp64\scripts\loaded_extensions.php on line 54

I have updated them as suggested, however I still do not have remote php debug capability.
Maybe newer versions op php will not be compatible with komodo?
my settings now are:

zend_extension_ts=“C:/Program Files (x86)/ActiveState Komodo IDE 12/lib/support/php/debugging/8.1/ts-vs16-x64/php_xdebug.dll”
zend_extension=“C:/Program Files (x86)/ActiveState Komodo IDE 12/lib/support/php/debugging/8.1/nts-vs16-x64/php_xdebug.dll”
xdebug.mode=debug
xdebug.remote_handler=dbgp
xdebug.start_with_request=trigger
xdebug.client_host=127.0.0.1
xdebug.client_port=9000
xdebug.idekey=“jdoe”

Any ideas how I can get remote debug to work?


Update:

So my remote debugging is back up. Hooray for me :slightly_smiling_face:

This worked with wamp and using php 8.1.
Note that xdebug setting names have changed for higher versions.

The following php.ini settings under ";Dynamic Extensions " seemed to do the trick. I also had to comment out duplicate xdebug settings at the bottom of the file.

zend_extension = xdebug
xdebug.mode=debug
xdebug.remote_handler=dbgp
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9000
xdebug.idekey=jdoe
xdebug.discover_client_host=1

Hey good digging @Vince_Pelss. This will be super helpful for others.

I’ve made a diff of what I think your change ended up being compared to the documented php.ini settings:

diff --git a/service/dashboard/php.ini b/service/dashboard/php.ini
index f52e51f63a..fc9bf6d712 100644
--- a/service/dashboard/php.ini
+++ b/service/dashboard/php.ini
@@ -1,8 +1,10 @@
+;Dynamic Extensions
 zend_extension_ts="c:\path\to\php_xdebug.dll"
-zend_extension="c:\path\to\php_xdebug.dll"
-xdebug.remote_enable=1
+zend_extension = xdebug
+xdebug.mode=debug
 xdebug.remote_handler=dbgp
-xdebug.remote_mode=req
-xdebug.remote_host=127.0.0.1
-xdebug.remote_port=9000
-xdebug.idekey=<idekey>

+xdebug.start_with_request=yes
+xdebug.client_host=127.0.0.1
+xdebug.client_port=9000
+xdebug.idekey=jdoe
+xdebug.discover_client_host=1

Let me know if that matches what you have.

One question: can you ellaborate on your comment about ;Dynamic Extensions? I can’t find any documentation about what that is so I’m not sure I’ve done that correctly. Did you get that from the xdebug docs?

I should note that for local debugging, you don’t need to set the PHP.ini file location in your preferences. Komodo creates a php.ini file based on the PHP you pointed it at. You can find that ini file in your Komodo Profile folder in the php folder.

If local debugging wasn’t working then it’s likely that the folder structure you constructed (perhaps from incorrect instructions from me) was not quite right. You can see what Komodo is looking for in the php.ini file in the php folder I mention above.

There is only old data in
C:\Users\vpels\AppData\Local\activestate\KomodoIDE\12.0\php
Just 7.3.21 and 5.6.40 folders
Maybe komodo doesn’t like the number 8 or a wamp change is killing a komodo search

I did a 'Run First Start Wizard ’ found under Help. No change. Probably something to do with a change in the newer WAMPs.

Regarding Dynamic Extensions

I was following:

“Add Xdebug to php
In the “Dynamic Extension” section, add the lines specified below. Edit the values to reflect your particular environment (see Xdebug settings explained below).”

The following is in my:
C:\wamp64\bin\apache\apache2.4.51\bin\php.ini

(via WAMP)

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; vince
zend_extension = xdebug
xdebug.mode=debug
xdebug.remote_handler=dbgp
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9000
xdebug.idekey=jdoe
xdebug.discover_client_host=1

;(very bottom of file)
; XDEBUG Extension
[xdebug]
zend_extension=“c:/wamp64/bin/php/php8.1.0/zend_ext/php_xdebug-3.1.1-8.1-vs16-x86_64.dll”
xdebug.output_dir =“c:/wamp64/tmp”
xdebug.show_local_vars=0
xdebug.log=“c:/wamp64/logs/xdebug.log”
xdebug.log_level=7

We can dig into this more if you like but it sounds like you’re all set. Let me know if you want to dig more.

If you do want to dig more I’d be interested in what your logs (Help menu > Troubleshooting > View log file) say when you click Re-check Config in the PHP prefs and you do NOT have Directory containing php.ini set.

  • Carey

I am content that I can debug php again. Now I have to get my perl up and running again :wink:

Doing what you suggested (without Directory containing php.ini set)

[2022-12-05 17:31:44,934] [DEBUG] ko.launch: Response: https://community.komodoide.com/changelog/120 (0)
[2022-12-05 17:31:46,792] [WARNING] console-logger: Empty string passed to getElementById(). (1) in chrome://global/content/bindings/richlistbox.xml:361
[2022-12-05 17:31:46,792] [WARNING] console-logger: Empty string passed to getElementById(). (1) in chrome://global/content/bindings/richlistbox.xml:366
[2022-12-05 17:31:46,934] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
[2022-12-05 17:31:47,438] [WARNING] console-logger: Empty string passed to getElementById(). (1) in chrome://global/content/bindings/richlistbox.xml:361
[2022-12-05 17:31:47,440] [WARNING] console-logger: Empty string passed to getElementById(). (1) in chrome://global/content/bindings/richlistbox.xml:366
[2022-12-05 17:31:52,188] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
[2022-12-05 17:31:52,726] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
[2022-12-05 17:31:53,707] [ERROR] koPHPConfigurator: Unexpected compiler: Visual C++ 2019
[2022-12-05 17:31:53,709] [WARNING] koPHPConfigurator: Debugger extension for PHP version 8.1.0 (path C:\Program Files (x86)\ActiveState Komodo IDE 12\lib\support\php\debugging\8.1\php_xdebug.dll) is not available.
[2022-12-05 17:32:03,255] [ERROR] koAppInfo: PHP command timed out: [u’c:\\wamp64\\bin\\php\\php8.1.0\\php.exe’, ‘-q’, ‘c:\\users\\vpels\\appdata\\local\\temp\\tmpsaoeq6.php’]
[2022-12-05 17:32:09,115] [ERROR] koAppInfo: PHP command timed out: [u’c:\\wamp64\\bin\\php\\php8.1.0\\php.exe’, ‘-q’, ‘c:\\users\\vpels\\appdata\\local\\temp\\tmpdivsoi.php’]
[2022-12-05 17:32:09,115] [ERROR] koAppInfo: could not determine PHP version number for ‘c:\wamp64\bin\php\php8.1.0\php.exe’:

PHP interpreter did not return in time.

[2022-12-05 17:32:14,983] [ERROR] koAppInfo: PHP command timed out: [u’c:\\wamp64\\bin\\php\\php8.1.0\\php.exe’, ‘-q’, ‘c:\\users\\vpels\\appdata\\local\\temp\\tmp3l1zda.php’]
[2022-12-05 17:32:14,984] [ERROR] koAppInfo: could not determine PHP version number for ‘c:\wamp64\bin\php\php8.1.0\php.exe’:

PHP interpreter did not return in time.

[2022-12-05 17:32:14,984] [WARNING] koPHPConfigurator: Unable to retrieve PHP version
[2022-12-05 17:32:15,466] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
[2022-12-05 17:32:15,546] [ERROR] console-logger: TypeError: tab is undefined (2) in viewbrowser:133
Traceback (most recent call last):
File “viewbrowser”, line 133, in

[2022-12-05 17:32:16,576] [ERROR] debugSessionTab:
– EXCEPTION START –
TypeError: varTreeView is undefined

  • stack
    DebugSessionTabManager.prototype.clearVariables@chrome://komodo/content/debugger/debugSessionTab.js:376:17
    DebugSessionTabManager_sessionEnd@chrome://komodo/content/debugger/debugSessionTab.js:315:9
    DBG_Session.prototype.shutdown@chrome://komodo/content/debugger/debugger.js:1267:13
    DBG_Session.prototype.updateUI@chrome://komodo/content/debugger/debugger.js:1463:17
    DBG_Manager.prototype.notifyDebuggerSessionStateChange@chrome://komodo/content/debugger/debugger.js:500:17
    – EXCEPTION END –
    [2022-12-05 17:32:16,582] [ERROR] debugSessionTab:
    – EXCEPTION START –
    TypeError: varTreeView is undefined
  • stack
    DebugSessionTabManager.prototype.clearVariables@chrome://komodo/content/debugger/debugSessionTab.js:376:17
    DebugSessionTabManager_sessionEnd@chrome://komodo/content/debugger/debugSessionTab.js:315:9
    DBG_Session.prototype.shutdown@chrome://komodo/content/debugger/debugger.js:1267:13
    DBG_Session.prototype.updateUI@chrome://komodo/content/debugger/debugger.js:1463:17
    DBG_Manager.prototype.notifyDebuggerSessionStateChange@chrome://komodo/content/debugger/debugger.js:500:17
    – EXCEPTION END –
    [2022-12-05 17:34:32,733] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
    [2022-12-05 17:34:33,108] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
    [2022-12-05 17:34:39,403] [ERROR] koAppInfo: PHP command timed out: [u’c:\\wamp64\\bin\\php\\php8.1.0\\php.exe’, ‘-q’, ‘c:\\users\\vpels\\appdata\\local\\temp\\tmprv9ca3.php’]
    [2022-12-05 17:34:43,796] [WARNING] prefs: The ‘phpConfigFile’ preference has changed while the pref window was open. If you get this message, a pref panel is incorrectly modifying prefs and the modified value will be lost.
    [2022-12-05 17:34:43,815] [WARNING] prefs: The ‘all’ preference has changed while the pref window was open. If you get this message, a pref panel is incorrectly modifying prefs and the modified value will be lost.
    [2022-12-05 17:34:52,336] [ERROR] koPHPConfigurator: Unexpected compiler: Visual C++ 2019
    [2022-12-05 17:34:52,336] [WARNING] koPHPConfigurator: Debugger extension for PHP version 8.1.0 (path C:\Program Files (x86)\ActiveState Komodo IDE 12\lib\support\php\debugging\8.1\php_xdebug.dll) is not available.
    [2022-12-05 17:35:12,374] [WARNING] console-logger: Unknown descriptor ‘font-display’ in @font-face rule. Skipped to next declaration. (1) in less://komodo/skin/global/global.less:1429
    [2022-12-05 17:38:14,262] [WARNING] console-logger: Key event not available on GTK2: key=“u” modifiers=“control,shift” (1) in chrome://komodo/content/tail/tail.xul:0

Thanks for those logs. Looks like, as you said, Komodo just doesn’t like PHP 8. For some reason it can’t run the php.exe -q command. I’m suspect that’s not actually effecting debugging though. The more interesting error is farther down.

Looks like the format of the compiler name changed with a newer version of the VS Compiler. Interestingly enough, we very recently made all this code open source so I can actually show you what’s failing: OpenKomodoIDE/koPHPConfigurator.py at 168e9d1232a6d0a442b8643a2fec152c8e520e57 · ActiveState/OpenKomodoIDE (github.com)

On the downside; ActiveState won’t be releasing a fix for this. More info regarding that will be coming out in the next few days.

On the upside; that’s a plain Python and therefore can just be patched in the install if you’re so inclined.

Regarding getting Perl running, be sure to start a new thread for that if you need help.

  • Carey

Thanks for all your hard work and assistance.

I am good here.

I can debug php and perl.

Good to go.