Eclipse IDE
The Eclipse IDE Integrated Development Environment is open source and provides an excellent environment to develop web applications. This guide provides all necessary steps to setup and get it running, and was modified for installation of the following versions:
XAMPP | 5.6.32 | 7.2.14 |
Eclipse for PHP Developers | Oxygen 1a (4.7.1a) | |
PHP | 5.6.32 | 7.2.14 |
MariaDB | 10.1.28 | 10.1.36 |
MySQL | (5.6.32) | |
XAMPP
Installation
Install
XAMPP packages on a Linux client through the packet manager or download location.
Install
XAMPP on a Windows client. Keep all path definitions relative, e.g. without the drive letter, except the reference to the xdebug dll. Make sure xampp is installed to a root directory, e.g. X:\xampp. “X” can be any drive letter available to your system, also a portable one. Besides the reference to the xdebug dll, the installation remains portable.
Install
XAMPP Portable on a Windows client to integrate into the portable apps environment.
Apache
Modify x:\xampp\apache\conf\httpd.conf. The best way to integrate with eclipse is to point the DocumentRoot to your project directory:
DocumentRoot "x:/joomla/htdocs"
<Directory "x:/joomla/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Alternatively, you can keep the default DocumentRoot and add an alias to your project directory:
<Directory "x:/joomla/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "x:/xampp/cgi-bin/"
Alias /joomla "x:/joomla/htdocs/"
</IfModule>
To enable SSL, you need to set the DocumentRoot in C:\xampp\apache\conf\extra\httpd-ssl.conf
DocumentRoot "x:/joomla/htdocs"
PHP
Modify x:\xampp\php\php.ini:
output_buffering=off
short_open_tag = On
max_execution_time=120
max_input_time=150
memory_limit=256M
error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors=On
post_max_size=16M
upload_max_filesize=128M
date.timezone=Asia/Bangkok
;extension=php_imap.dll
;extension=php_pdo_odbc.dll
Download
phpMyAdmin latest version and replace the folder in /xampp
If your htdocs directory is on a different drive than the xampp installation, then you need to either add the drive to “session.save_path” in php.ini, or create an equivalent folder path on the drive where your htdocs folder resides.
session.save_path = "C:\xampp\tmp"
MariaDB / MySQL
Create user to connect with in your application. Give him sufficient access privileges.
If you have existing projects, copy the database directories and files to x:/xampp/mysql/data.
Create access for your user for host '%' and 'localhost' (2 entries) with the necessary privileges.
Default options are read from the following files in the given order:
C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf C:\xampp\mysql\my.ini C:\xampp\mysql\my.cnf C:\xampp\mysql\bin\my.ini C:\xampp\mysql\bin\my.cnf
Links
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
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.
-
In Eclipse go to Help → Install New Software…
-
Mark the plugin version you would like to install then press Next…
On Install Details press Next…
Review and confirm the plugin to install.
Restart Eclipse.
Settings
Go to Window → Preferences → General and enable “Show heap status”.
Go to
Window → Preferences → General → Workspace and modify the Workspace settings.
Go to
Window → Preferences → General → Web browser and set the desired browser for browser output.
Go to
Window → Preferences → PHP → Servers and enter the web server settings.
Go to
Window → Preferences → PHP → Validation and set the PHP version.
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.
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
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.
Window –> Preferences –> PHP –> Code Style –> Formatter. Select “PHP Conventions” as active profile.
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