Changes

From SME Server
Jump to navigationJump to search
Line 72: Line 72:  
I have been using Komodo IDE courtesy of an Open Source Developers licence from [http://komodoide.com/ Activestate]
 
I have been using Komodo IDE courtesy of an Open Source Developers licence from [http://komodoide.com/ Activestate]
   −
They produce an Open Source 'light' version of the full IDE called [http://komodoide.com/komodo-edit/ Komodo Edit] but it does not have the debug facilities.
+
You can now get the app for free here but need a free account to use it:
 +
 
 +
https://www.activestate.com/products/komodo-ide/download-ide/
    
The simplest mode to use with Komodo IDE is to just use the IDE as a debugger to step through code. Code on the remote server can be edited if you have sufficient permissions.
 
The simplest mode to use with Komodo IDE is to just use the IDE as a debugger to step through code. Code on the remote server can be edited if you have sufficient permissions.
   −
http://docs.komodoide.com/Manual/debugperl
+
https://docs.activestate.com/komodo/12/manual/debugger.html
   −
This will enable us to work with one desktop and one server. See the section on debug proxy for multiple connections
+
This will enable us to work with one desktop and one server. See the section on debug proxy for multiple connections.
    
====Server setup====
 
====Server setup====
Line 139: Line 141:  
In Komodo preferences you need to setup a Server/Remote Account for the remote server. e.g.
 
In Komodo preferences you need to setup a Server/Remote Account for the remote server. e.g.
   −
  Remote Account : Test_v9
+
  Remote Account : Test_v10
 
  Type: SCP
 
  Type: SCP
 
  Port: 2222
 
  Port: 2222
Line 159: Line 161:  
====Local file mapping====
 
====Local file mapping====
   −
Although I have not tried this I believe that you can potentially map from the server to your local files. You can then edit locally, upload and re test.
+
I seemed to have managed this using sshfs:
 +
 
 +
shfs -p 2222 root@192.168.10.199:/ ~/Mounts/somedirectory
 +
 
 +
You can then access the files normally and it is easy to map the remote to the 'local' files.
    
====Tidying up afterwards====
 
====Tidying up afterwards====
Line 195: Line 201:  
Notes are here:
 
Notes are here:
 
http://docs.komodoide.com/Manual/debugger#debugging-programs-komodo-ide-only_remote-debugging_debugger-proxy
 
http://docs.komodoide.com/Manual/debugger#debugging-programs-komodo-ide-only_remote-debugging_debugger-proxy
 +
 +
===Perl with Visual Studio===
 +
 +
Still working on this but we need Perl Language Server
 +
 +
  yum --enablerepo=* install gcc gcc-c++ perl-App-cpanminus perl-AnyEvent-AIO perl-Coro
 +
 +
  cpanm Class::Refresh
 +
  cpanm ExtUtils::CBuilder
 +
 cpanm Compiler::Lexer
 +
 cpanm Hash::SafeKeys
 +
  cpanm Perl::LanguageServer
    
====PHP remote debugging====
 
====PHP remote debugging====
Line 203: Line 221:  
First you need to install the xdebug packages eg:
 
First you need to install the xdebug packages eg:
   −
  yum install php74-php-pecl-xdebug
+
{{Note box|Xdebug 3 is not available for PHP versions less than 7.2 You will need php54-php-pecl-xdebug}}
  yum install php80-php-pecl-xdebug
+
 
 +
  yum install php74-php-pecl-xdebug3
 +
  yum install php80-php-pecl-xdebug3
 +
 
 +
Or
 +
 
 +
yum install php*php-pecl-xdebug3
 +
 
 +
Next you need a small template fragment to enable remote debugging.
   −
Next you need a small template fragment to enable remote debugging:
+
=====Xdebug 2=====
    
  mkdir -p /etc/e-smith/templates-custom/etc/php.ini
 
  mkdir -p /etc/e-smith/templates-custom/etc/php.ini
Line 217: Line 243:  
  xdebug.remote_enable                  = true
 
  xdebug.remote_enable                  = true
 
  xdebug.remote_host                    = 127.0.0.1
 
  xdebug.remote_host                    = 127.0.0.1
  xdebug.remote_port                    = 9000
+
  xdebug.remote_port                    = 9001
 
  xdebug.remote_handler                  = dbgp
 
  xdebug.remote_handler                  = dbgp
 
  xdebug.remote_log                      = /var/log/xdebug.log
 
  xdebug.remote_log                      = /var/log/xdebug.log
 
  xdebug.remote_mode                    = req
 
  xdebug.remote_mode                    = req
 
  xdebug.max_nesting_level              = 5000
 
  xdebug.max_nesting_level              = 5000
 +
 +
 +
=====Xdebug 3 =====
 +
 +
New syntax.
 +
 +
https://xdebug.org/docs/upgrade_guide
 +
https://xdebug.org/docs/all_settings
 +
 +
nano /etc/e-smith/templates-custom/etc/php.ini/90XdebugSettings
 +
 +
[Debugger]
 +
xdebug.start_with_request              = yes
 +
xdebug.discover_client_host            = true
 +
xdebug.client_host                      = localhost
 +
xdebug.client_port                      = 9003
 +
xdebug.idekey                          = users
 +
xdebug.mode                            = debug
 +
xdebug.log                              = /var/log/xdebug.log
 +
    
Expand templates and restart services:
 
Expand templates and restart services:
Line 235: Line 281:  
     with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
 
     with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
 
     with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
 
     with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
 +
 +
Or like this:
 +
 +
php80 -v
 +
PHP 8.0.19 (cli) (built: May 10 2022 08:07:35) ( NTS gcc x86_64 )
 +
Copyright (c) The PHP Group
 +
Zend Engine v4.0.19, Copyright (c) Zend Technologies
 +
    with Zend OPcache v8.0.19, Copyright (c), by Zend Technologies
 +
    with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
    
====Komodo IDE====
 
====Komodo IDE====
Line 240: Line 295:  
We can obtain the debug proxy from the installation, and move it to the server and then execute from there:
 
We can obtain the debug proxy from the installation, and move it to the server and then execute from there:
   −
  python /root/dbgp/bin/pydbgpproxy -d 127.0.0.1:9000 -i 192.168.10.1:9003
+
  python /root/dbgp/bin/pydbgpproxy -d 127.0.0.1:9001 -i 192.168.10.1:9003
    
Or alternatively grab the lastest xdebug client here:
 
Or alternatively grab the lastest xdebug client here:
Line 248: Line 303:  
  curl https://xdebug.org/files/binaries/dbgpProxy -o dbgpProxy
 
  curl https://xdebug.org/files/binaries/dbgpProxy -o dbgpProxy
 
  chmod 0700 dbgpProxy
 
  chmod 0700 dbgpProxy
  ./dbgpProxy -s 127.0.0.1:9000 -i 192.168.10.1:9003
+
  ./dbgpProxy -s 127.0.0.1:9001 -i 192.168.10.1:9003
    
In Komodo Go to Preferences, Debugger, Connections
 
In Komodo Go to Preferences, Debugger, Connections
Line 269: Line 324:  
https://your.server.ip/index.php?somevalue=3&XDEBUG_SESSION_START=mydesktopkey
 
https://your.server.ip/index.php?somevalue=3&XDEBUG_SESSION_START=mydesktopkey
   −
====Visual Studio/VS Codium====
+
====Visual Studio/VS Codium ====
    
Sample launch.json
 
Sample launch.json
Line 290: Line 345:  
             "enable" : true,
 
             "enable" : true,
 
             "host" : "my.server.ip",
 
             "host" : "my.server.ip",
             "key" : "mycodiumkey",
+
             "key" : "users", // As set in the server above
 
             "port": 9003,
 
             "port": 9003,
 
             "allowMultipleSessions" : true
 
             "allowMultipleSessions" : true

Navigation menu