Eclipse is an open-source integrated development environment (IDE) used for computer programming. It is very popular for developing Java applications, but through plugins, Eclipse can be turned into a multi-language programming software application. Eclipse is free-to-use and has all the features one would expect from any proper IDE, including:
- Syntax highlighting
- Content assist
- Code formatting
- Code templates
- Code navigation, etc.
Eclipse for PHP developers
The default Eclipse download files include almost all the packages needed for PHP, CSS and HTML programming. To be able to connect to a remote website, the Remote System Explorer can be added.
Eclipse is available for Mac OS X (64 bit),Windows and Linux (32 & 64 bit) operating systems. To use Eclipse (after it has been downloaded and extracted), Java needs to be installed (see below).
On the downloads page, under Get Eclipse Oxygen (at the time of writing) -> click Download Packages. For the default version of Eclipse, choose Eclipse for PHP Developers (32-bit or 64-bit) -> Download. The file will download as a compressed zip-file.
There is no need to run any installer. Eclipse is installed by simply extracting the downloaded file into a directory of choice (e.g. c:\eclipse). When it is no longer needed, the entire Eclipse directory can be deleted without running any un-installer. Multiple copies of Eclipse can be created and used on the same machine.
Eclipse needs Java (8 or higher) to function. Java Runtime (JRE) is needed for running Java programs. The Java Development Kit (JDK, which includes JRE), is needed for writing (developing) as well as running Java programs. For non-Java programmers, the JRE will be enough. At the time of writing, the newest version of Java was 10.
Before installing a newer version of Java, the older version(s) should be uninstalled. To see if, or what version(s) of Java has already been installed, the Windows Programs and Features (in the Window Control Panel) can be used. This is also where older versions of Java can be uninstalled.
From the Java SE Downloads page, the required Java environment (JDK or JRE) can be selected after which the operating system distribution is selected for download.
Creating a workspace and project
Upon opening Eclipse for the first time, a popup screen will ask for workspace instructions. A workspace is the concept used for grouping related Eclipse settings, related projects and related configuration pertaining to these projects. Workspaces are saved as individual directories.
In the case where a known workspace already exists, the Browse… button can be used to set its location, otherwise a new workspace can be created. Multiple workspaces can be used.
After the workspace has been determined, the Eclipse welcome screen will be shown with multiple options. From here, new PHP projects can be selected. Projects will be saved as directories within the workspace and multiple projects can be created and used.
In this case a new PHP project, named, New PHP Project Alpha, was created with the default settings. The workspace will show all the created projects in the Project Explorer.
After closing Eclipse, the workspace will be saved automatically. To go to the chosen workspace’s Project Explorer from the welcome screen without creating a new project, click on the Workbench button.
Eclipse Remote System Explorer (RSE)
To be able to develop on a remote location, e.g. on a web server, Eclipse has, what they call, a Remote System Explorer. The RSE is installed as plugin software (see below). It is basically a separate explorer, similar to the Project Explorer, but with remote locations.
The RSE enables the use of FTP (among other connection protocols) to connect to remote websites. The RSE can also connect to a local network web directory via SSH or SFTP and can be used to do basic FTP commands such as copying, renaming and creating directories.
Installing the Eclipse Remote System Explorer
While in the desired workspace’s Project Explorer, choose Help > Install New Software. Under Work with: select –All Available Sites– Under filter, type “remote system explorer” and click on the Select All button.
Click the Next > button. Follow the on-screen instructions to finish installing the software. The RSE will now be available to use in all the workspaces that is in the install directory.
Switching to the Eclipse Remote System Explorer perspective
After the RSE software has been installed successfully, the Remote System Explorer perspective can be activated. Go to Window > (Perspective) > Open Perspective > Other > Remote System Explorer. This step only has to be done once. The perspective button is also available on the top right corner of the workspace.
After the Eclipse Remote System Explorer perspective has been activated, it can be viewed by choosing its icon on the top right corner of the workspace. To go back to the (PHP) Project Explorer, its icon can be chosen.
Creating a new remote connection
From the Remote System Explorer, new connections can be created by right clicking in the Remote Systems window, choosing New > Connection… Multiple remote site connections (accessible at the same time) can be created.
To update Eclipse to the latest version, select Help -> Check for Updates.