This is an old revision of the document!


Eclipse IDE

The Eclipse IDE Integrated Development Environment is open source and provides an excellent environment to develop web applications. I migrated the LAMP server from XAMPP to WSL (Windows Subsystem for Linux) with the arrival of Windows 10. See here for XAMPP related instructions.

Application Version
Eclipse for PHP Developers 2024-03
OS Debian 12.5
Apache 2.4.59
PHP 8.3.7
MariaDB 10.11.61

1MariaDB 10.11 versus MySQL 8.0

LAMP with Xdebug

  • Review your php.ini:
    output_buffering=off
    short_open_tag = On
    max_execution_time=120
    max_input_time=150
    max_input_vars = 2000
    memory_limit = 512M
    error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
    display_errors=On
    post_max_size = 32M
    sys_temp_dir = "/tmp"
    upload_tmp_dir = "/tmp"
    upload_max_filesize=128M
    date.timezone=Asia/Bangkok

WSL (Windows Subsystem for Linux)

WSL1

  • WSL1 runs networking in bridged mode
  • You do not need to set xdebug.client_host (Xdebug2: xdebug.remote_host)
  • Will work with default configuration settings

WSL2

  • WSL2 runs networking in NAT or mirrored mode
  • WSL2: run the following command in PowerShell:
    New-NetFirewallRule -DisplayName "xdebug" -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))" -Direction Inbound -Protocol TCP -LocalPort 9003 -Action Allow
  • Check with:
    Get-NetFirewallRule -DisplayName "xdebug"
  • Check logfile with tail -f /path/to/log/xdebug.log

Eclipse IDE

Java

Eclipse requires Java to run, so install this first.

Eclipse

XDebug for PHP 7.2

To activate the debugger, you need to add the following lines to the bottom of x:/xampp/php/php.ini:

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-2.6.1-7.2-vc15.dll" ; IMPORTANT: Windows does not find the dll if the drive letter is missing!
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "\xampp\tmp"
xdebug.remote_cookie_expire_time = 36000
  • Other options can be left at default values. Check the settings have been recognized by checking phpinfo.
  • XAMPP does not contain the correct php_xdebug.dll, download it from here and put it into folder x:/xampp/php/ext.
  • Make sure you have Visual C++ 2017 installed.

XDebug for PHP 5.6

To activate the debugger, you need to add the following lines to the bottom of x:/xampp/php/php.ini:

[Xdebug]
zend_extension=H:\xampp\php\ext\php_xdebug.dll
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.trace_output_dir = "\xampp\tmp"

Other options can be left at default values. Check the settings have been recognized by checking phpinfo. xampp comes with the correct php_xdebug.dll file already located in x:/xampp/php/ext.

Links

JavaScript

Links

TypeScript

Install the TypeScript IDE for Eclipse.

  1. Install required software: Java 7, Eclipse Kepler 4.3 or higher, Node.js.
  2. In Eclipse go to Help → Install New Software…
  3. Mark the plugin version you would like to install then press Next…
  4. On Install Details press Next…
  5. Review and confirm the plugin to install.
  6. Restart Eclipse.

Settings

  1. Go to Window → Preferences → General and enable “Show heap status”.
  2. Go to Window → Preferences → General → Workspace and modify the Workspace settings.Workspace
  3. Go to Window → Preferences → General → Web browser and set the desired browser for browser output.Web browser
  4. Go to Window → Preferences → PHP → Servers and enter the web server settings.PHP Server
  5. Go to Window → Preferences → PHP → Validation and set the PHP version.Validation
  6. Go to Window → Preferences → PHP → Debug → Debuggers and check the XDebug settings. They must comply with the settings in the php.ini file. Set “Accept remote session (JIT)” to off if you don't want the debugger to automatically start when opening any URL on localhost.XDebug
  7. There are three places where the “Break on first line” configuration can be set:
    • Window → Preferences → PHP → Debug
    • Project → Properties → PHP → Debug
    • Run → Debug Configurations → PHP Web Application → <Your configuration> → Debugger
  8. Add or Edit Debug Configurations…. If you pointed the DocumentRoot to your workspace, then you can leave the URL on “Auto Generate”, otherwise you must modify the URL.Debug Configuration
  9. Window –> Preferences –> PHP –> Code Style –> Formatter. Select “PHP Conventions” as active profile.PHP Formatter
  10. If you have existing projects
    • either select the project directory as workspace when first starting up the new eclipse, or
    • delete the workspace directories and files (filenames start with “.”), then import the project directories with File –> Import –> General –> Existing Projects into Workspace

Links