Setting Up Eclipse PDT with UniServer for PHP Development (Part 2 of 2)

Eclipse PDT is an IDE for the development of PHP projects.

Installing Eclipse PDT is not a big challenge. However, Configuring Eclipse for Windows can be entertaining (to say the least). That is what part 2 of this series covers … installation and configuration for Eclipse PDT for Windows environment.

If you have a WAMP installed on your computer, you are ready to install Eclipse PDT. If not, return to part one of this article series to install a WAMP.

Finding Eclipse PDT

To find Eclipse PDT, head on over to http://www.zend.com/en/company/community/pdt/downloads and click download.

You will be required to register with the site, to join the community of users. However, the download is free.

Installing Eclipse PDT

Installation of Eclipse PDT is not a typical Windows install. The package comes as a simple zip file. You will choose a directory you would like to use as the tool’s home, and unpack the zip file into that directory. When done, go to the directory, find zend-eclipse-php.exe and create a link to this on your desktop. This shortcut will be your access to eclipse PDT.

Configuring Eclipse PDT

Configuring can be a nuisance for Eclipse PDT, but, here we go. Follow along and you should be fine.

In preparation, you need to determine a few facts:

  • What physical directory has been defined as your “localhost” by your WAMP?
  • What sub-directory of your WAMP localhost do you want as your development area? You will put all your projects in sub-directories of the development area.
  • What would you like to name your development area? Eclipse PDT will call this your workspace. Your projects will end up as sub-directories in the workspace

Now you are ready… begin:

  1. Define your workspace – if you have not yet defined a workspace

    • Click “File” in the toolbar.
    • Hover over “Switch Workspace” and click “Other.”
    • On the switch workplace screen, select browse and browse to the location you would like to make into a workplace. You may use the browse tool to create new directories, and select that directory as the directory to switch too.

    Be certain your new workspace is in the path defined as your development server.

  2. Configure Your General Preference

    • Click “Window” in the toolbar, a menu will pop-down.
    • Click Preferences in the drop down menu and a form will open.
    • Configure for PHP
      • Click “PHP” in the left column of drop down, a submenu will appear.
      • Click on “PHP Executables,” a list may appear … it may be blank.
      • If PHP 5 is not already listed, Click on “Add…,” a form will appear.
      • Fill in the Add PHP Executable” form with

        • PHP 5
        • (browse to and select your php.exe file)
        • CGI
        • XDebug
      • Click Debug, a new configurable set will open. Configure as follows:

        • XDebug
        • Default PHP Web Server
        • PHP 5
        • UTF-8
        • UTF-8
        • will already be set correctly, no need for change
        • click if you want to stop on first line for your debug purposes.
      • Click “PHP Servers,” a new configurable set will open. Assure the default PHP Web Server is mapped to http://localhost.” if not, either edit or add that information to the list of managed servers.

  3. Define a New Empty Project

    • Click “File” in the toolbar, the menu will dropdown.
    • Hover over “New,” and click the sub-option “Local PHP Project,” a form will pop up
    • Fill in the project name, the physical address of the directory to be used for the project, select to use either Basic or Zend Framework. The path must be in your workspace, and if you do know what a Zend Framework is … select Basic. Then, click “Next,” another form will appear.
    • On the new form, the host name should be fine, but, adjust the Base Path to include your path from the “localhost,” assuring that the “Project URL” on the page is correctly defined to location your project. Then, click “Next.”
    • On the Library Configuration page, select the usual libraries you use … typically, I select (a) JavaScript Web Project Support, (b) JQuery Library and (c) ExtJS Library. Then, Click Finish. The existing directory will be set up for use with Eclipse PDT.
    • If you would like to bring in files from other directories, do not simply copy them in, Import them or Eclipse will not recognize them.
  4. Create a project from an Existing Directory

    • Copy your files into a directory you would like to define as a new project directory
    • Click “File” in the toolbar, the menu will drop down.
    • Hover over “New,” and click the sub-option “PHP Project from Existing Directory, a form will pop up
    • Fill in the projects and the physical address of the project in a subdirectory of the workspace, a from will pop up. Then, click
      “Next.”
    • The host name should be fine, but, adjust the Base Path to include your path from the “localhost,” assuring that the Project URL on the page is correctly defined to location your project. Then, click “Next.”
    • On the Library Configuration page, select the usual libraries you use … typically, I select (a) JavaScript Web Project Support, (b) JQuery Library and (c) ExtJS Library. Then, Click “Finish.” The existing directory will be set up for use with Eclipse PDT.
  5. Configure Your Properties

    • Click “Project” in the toolbar, a menu will pop-down.
    • Click “Properties” in the drop down menu and a form will open.
    • Configure for PHP debugging
      • Click “PHP Debug” in the left column of drop down, Configurables will change in the right column.
      • Configure as follows:

        • XDebug
        • Default PHP Web Server
        • PHP 5
        • UTF-8
        • UTF-8
        • will already be set correctly, no need for change
        • click if you want to stop on first line for your debug purposes.

Leave a Reply