This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| web:eclipse [2024/05/21 17:37] – [WSL2] Bernard Condrau | web:eclipse [2026/01/29 13:31] (current) – [Setup] Bernard Condrau | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| < | < | ||
| - | ===== LAMP with Xdebug | + | ===== WSL Settings |
| - | | + | |
| - | * Review your php.ini:< | + | options=" |
| - | short_open_tag | + | - Stop wsl from the Windows command line:< |
| - | max_execution_time=120 | + | - Start wsl from the Windows command line:< |
| - | max_input_time=150 | + | - Check wsl instances from the Windows command line:< |
| - | 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 | + | |
| - | upload_tmp_dir = "/tmp" | + | |
| - | upload_max_filesize=128M | + | |
| - | date.timezone=Asia/Bangkok</ | + | |
| - | ===== WSL (Windows Subsystem for Linux) | + | ===== Install Eclipse IDE on WSL2 ===== |
| - | ==== WSL1 ==== | + | From the next chapter onwards this guide explains how to use Eclipse IDE under Windows. Installing Eclipse within Debian and running it from Windows through an X-Server has the huge advantage that the file permissions are maintained propberly. This chapter is taken from [[https://gist.github.com/ |
| - | * WSL1 runs networking in '' | + | |
| - | * You do not need to set '' | + | |
| - | * Will work with default configuration settings | + | |
| - | ==== WSL2 ==== | + | |
| - | * WSL2 runs networking | + | |
| - | * To enabled '' | + | |
| networkingMode=mirrored</ | networkingMode=mirrored</ | ||
| - | * The following instructions apply to the default '' | + | ==== Setup ==== |
| - | | + | [[https:// |
| - | * Check with:< | + | |
| - | * Check logfile with tail -f /path/to/log/xdebug.log | + | Access WSL2 using putty |
| + | Run Eclipse on WSL2 Ubuntu, displaying | ||
| + | Connecting to VcXsrv directly from WSL2 | ||
| + | Using SSH X11 forwarding, with network connection initiated from Windows to WSL2 Ubuntu, which is particularly useful on company laptops that refuse all incoming network connections on Windows. | ||
| + | Prerequisites: | ||
| + | |||
| + | WSL2 up and running | ||
| + | Putty, Plink & PuttyGen installed on Windows | ||
| + | WSL2 Ubuntu: Install & configure OpenSSH | ||
| + | |||
| + | sudo apt install openssh-server | ||
| + | |||
| + | Edit / | ||
| + | |||
| + | | ||
| + | X11DisplayOffset 10 | ||
| + | X11UseLocalhost no | ||
| + | sudo ssh-keygen -A | ||
| + | |||
| + | sudo service ssh start | ||
| + | |||
| + | Auto-start SSH daemon: | ||
| + | |||
| + | WSL2 Ubuntu: mkdir -p ~/bin ; echo "sudo service ssh start" >> ~/ | ||
| + | Windows: Create scheduled task that runs on user logon, running C: | ||
| + | Windows: Configure SSH public key authentication using PuttyGen: | ||
| + | |||
| + | See https:// | ||
| + | Run PuttyGen | ||
| + | Generate new key pair, or convert existing key pair | ||
| + | Save private key to ppk file; this will used later when connecting to WSL2 Ubuntu using Putty or PLink | ||
| + | Add the SSH public key to ~/ | ||
| + | Windows: Create putty profile to connect to WSL2 Ubuntu: | ||
| + | |||
| + | Session | ||
| + | Host Name: localhost | ||
| + | Port: 22 (or whatever OpenSSH port you configured on WSL2 Ubuntu) | ||
| + | Connection -> Data: | ||
| + | Auto-login username: <your user name> | ||
| + | Connection | ||
| + | Private key file for authentication: | ||
| + | Connection | ||
| + | Enable X11 forwarding | ||
| + | X display location: 127.0.0.1: | ||
| + | Windows: Install & configure VcXsrv: | ||
| + | |||
| + | Download & install https:// | ||
| + | Copy config.xlaunch as shown below to the Startup folder (Win+R: shell: | ||
| + | Launch config.xlaunch to start the X Server manually for now | ||
| + | WSL2 Ubuntu: Install Eclipse & prerequisites: | ||
| + | |||
| + | sudo apt-get install openjdk-11-jdk | ||
| + | sudo apt-get install libgtk-3-0 | ||
| + | Download and unpack Eclipse for Linux to ~/eclipse | ||
| + | Windows: Eclipse shortcut using SSH X11 tunnel: | ||
| + | |||
| + | Manually try starting Eclipse from Windows by running the following command: | ||
| + | plink.exe | ||
| + | Copy silent.vbs and plink-silent.cmd (see attached files) to the directory where PLink.exe is installed | ||
| + | Create a new shortcut that runs the following command: | ||
| + | C: | ||
| + | Double-click the shortcut; if all is well you should see the Eclipse UI after a couple of seconds | ||
| + | Windows: Eclipse shortcut using direct XServer connection: | ||
| + | |||
| + | Add the following lines to ~/.profile on WSL2 Ubuntu (create file if it doesn' | ||
| + | export DISPLAY=: | ||
| + | export LIBGL_ALWAYS_INDIRECT=1 | ||
| + | Note that having these lines in .bashrc won't work as .bashrc is only loaded for interactive shells | ||
| + | Create a new shortcut that runs the following command: | ||
| + | C: | ||
| + | ===== LAMP with Xdebug ===== | ||
| + | * Follow [[deb12: | ||
| - | ==== Links ==== | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| ===== Eclipse IDE ===== | ===== Eclipse IDE ===== | ||
| + | |||
| + | ==== PHP ==== | ||
| + | * Make sure '' | ||
| ==== Java ==== | ==== Java ==== | ||
| Line 58: | Line 114: | ||
| * [[https:// | * [[https:// | ||
| - | ==== XDebug for PHP 7.2 ==== | ||
| - | To activate the debugger, you need to add the following lines to the bottom of x:/ | ||
| - | [XDebug] | ||
| - | zend_extension = " | ||
| - | xdebug.remote_autostart = 1 | ||
| - | xdebug.profiler_append = 0 | ||
| - | xdebug.profiler_enable = 0 | ||
| - | xdebug.profiler_enable_trigger = 0 | ||
| - | xdebug.profiler_output_dir = " | ||
| - | ; | ||
| - | xdebug.remote_enable = 1 | ||
| - | xdebug.remote_handler = " | ||
| - | xdebug.remote_host = " | ||
| - | xdebug.remote_log = " | ||
| - | xdebug.remote_port = 9000 | ||
| - | xdebug.trace_output_dir = " | ||
| - | 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, | ||
| - | * Make sure you have Visual C++ 2017 installed. | ||
| - | * Download and install: [[https:// | ||
| - | * Check phpinfo: [[https:// | ||
| - | |||
| - | ==== XDebug for PHP 5.6 ==== | ||
| - | To activate the debugger, you need to add the following lines to the bottom of x:/ | ||
| - | [Xdebug] | ||
| - | zend_extension=H: | ||
| - | xdebug.remote_enable = 1 | ||
| - | xdebug.remote_port = 9000 | ||
| - | xdebug.trace_output_dir = " | ||
| - | 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:/ | ||
| - | |||
| - | === Links === | ||
| - | * [[https:// | ||
| - | * [[http:// | ||
| - | * [[https:// | ||
| - | * [[https:// | ||
| ==== JavaScript ==== | ==== JavaScript ==== | ||
| Line 125: | Line 144: | ||
| - Add or Edit **Debug Configurations...**. If you pointed the DocumentRoot to your workspace, then you can leave the URL on "Auto Generate", | - Add or Edit **Debug Configurations...**. If you pointed the DocumentRoot to your workspace, then you can leave the URL on "Auto Generate", | ||
| - **Window --> Preferences --> PHP --> Code Style --> Formatter**. Select "PHP Conventions" | - **Window --> Preferences --> PHP --> Code Style --> Formatter**. Select "PHP Conventions" | ||
| + | - **Window --> Preferences --> General --> Editors --> Text Editors**. Uncheck "Use find/ | ||
| - If you have existing projects | - If you have existing projects | ||
| * either select the project directory as workspace when first starting up the new eclipse, or | * either select the project directory as workspace when first starting up the new eclipse, or | ||