Eclipse IDE Eclipse PHP Development

Eclipse is an open source Integrated Development Environment (IDE) from the Eclipse Foundation. Eclipse supports Java development by default. However it contains a plugin ability which enables it to be used for developing in other languages and for different platforms. For example, there is an PDT plugin by Zend that gives Eclipse the added ability to develop applications for PHP. See more details about Eclipse history and capabilities.

Installation Download, Extract, Install, Configure

The PHP plugin PDT was created by Zend. To use the PDT you need the Eclipse IDE and a Java Runtime Environment (JRE) installed. The Eclipse IDE can be downloaded from the Eclipse downloads website. Once Eclipse has been installed, you may need to configure it to find the desired run-time and development files. Instructions for configuring eclipse can be found in documentation of the eclipse.ini file.

To install the PDT, go to <Help> <Install New Software> <Add Site> and add this URL: http://downloads.zend.com/pdt. Click the Install button. Restart Eclipse once install is finished.

Note: I am currently running Eclipse version 3.7.2 (Indigo) , which I downloaded from the Eclipse Indigo download website. (eclipse-SDK-3.7.2-win32.zip, 183,171,707 bytes). I extracted the downloaded file and then moved the resulting "eclipse" folder to the root of my C: drive. I created a shortcut on my desktop to C:\eclipse\eclipse.exe which I called "Eclipse - Indigo". Here are the version's release notes. I set my default Eclipse work space to "C:\Users\Kevin\workspace". I am using the PHP plugin version 3.2.0.201303070812 with PHP version 5.4.3 .

Setting up a PHP Server in Eclipse

Steps to set up a PHP server in Eclipse:

Note: You may wish to set Eclipse to use an external brower when running the PHP. See configurations below on how to make this change.

Setting up a PHP Project in Eclipse

Steps to set up a PHP project in Eclipse:

Note: You may wish to set Eclipse to use an external brower when running the PHP. See configurations below on how to make this change.


Eclipse Configurations for PHP
  1. Set editor to use spaces instead of tabs.
    • Window -> Preferences
    • PHP -> Code Style
    • Formatter -> Edit
    • Set Tab Policy: to "Spaces only".
    • Apply -> OK
  2. Set PHP to run scripts using an external browser, instead of it's internal browser.
    • Window -> Preferences
    • General ->Web Browser
    • Select: Use external web browser.
    • Select the particular external web browser to use.
    • Apply -> OK

    Working Faster with Eclipse Shortcuts and Tips
Eclipse Short Cut Keys
Short Cut Keys
Keys Short Cut Description
<Ctrl><F11> Run Runs the program.
<Ctrl><Space> Content Assist Context Auto Completion.
<Ctrl><Shift>O Organize Imports Missing classes are imported. Unused imports removed.
<Ctrl><Shift>F Source Format Format source code as set up in formatter.
<Shift><Tab> Move Blocks of Code Move Blocks of code left and right.
<Ctrl>/ Inline Comments Quickly comment and uncomment sections of code.


Top | Install | Working