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

General Observations

Not the most convenient or intuitive IDE in the world, Eclipse is still a convenient IDE to use if you are not into spending big money on other developers … but, would like some very useful tools for development. If set up correctly, Eclipse PDT can help develop PHP projects with very useful debug options.

Some of the problems with Eclipse PDT include:

  • Setup can be a pain, it is definitely not load and go
  • Extra effort my be needed if you are not using Zend Server
  • You define your projects, but, deleting projects is a nuisance to do

I should mention, I am not an Eclipse expert. Definitely, it was a massive effort to hunt and peck my way through the installation. This article is to help me remember the process the next time I need to go through the process. It has a bit of rambling side information for those of you that find this articles and are curious why I have elected to do some of the setup that I do to use Eclipse. I hope it helps you too.

Preparation to use Eclipse PDT

To use Eclipse PDT, you must have the ability to run PHP. This implies the availability of a Server environment. Preparation suggests you install an AMP environment. In the case of this article, I have a WAMP environment.

I am developing on a WAMP environment; Windows, Apache, MySql & PHP. To maintain the database, I like using phpMyAdmin. To meet my needs for Apache and mySQL, I have tried using Zend Server.

Zend Server is an interesting, having lots of bells and whistles, but, I find that it is a pain to install phpMyAdmin on Zend Server hosted on Windows. Zend Server has a “simple” button press “deployment” of phpMyAdmin on their Zend Server, but, it fails in Windows. Notes around the internet indicate it works in Unix and Linux but, phpMyAdmin does not deploy conveniently on Windows at this time … true.

Even more inconvenient, uninstall of Zend Server does not do a complete uninstall. Zend Server installs IBM DB2 Server, but, does not remove it in the uninstall. This incomplete uninstall leaves the IBM DB server blocking access to port 3306 for other WAMP package installs. If you want to use port 3306, for the database servers with some other WAMP package like Uniserver, Wampserver, UmAmp … you will need to be aware and uninstall the DB2 server separately. Failure to uninstall IBM DB2 results in the failure of other WAMP packages to install completely. In the future, I may try Zend Server again using a Linux environment, but, not on Windows … until they solve their Windows compatibility problem with phpMyAdmin.

On Windows, I find the Uniform Server (UniServer) extremely convenient to install. I have used UniServer for about 10 years and never have had problems with Uniserver. The installation is quick, simple, and always works. UniServer includes mySQL, PHP and phpMyAdmin and meets my development needs nicely. Load and go in a Windows development environment.

If you are looking to use Eclipse, I assume you have an AMP package installed. If you have a AMP package installed, you can skip to Installing Eclipse PDT. If you are using Windows and need a WAMP package, the following two short sections will help.

Find Uniform Server

Uniform Server can be found at http://www.uniformserver.com/. Go on over to the UniServer site and click Download to retrieve the latest version of UniServer.

Installation of UniServer

To install UniServer:

  • Choose a where you would like to install UniServer. Some would choose the “Windows File” directory, but, I prefer to place it elsewhere. Your development files will be placed in a subdirectory below this and I do not like my development files stored below the Windows/Program Files subdirectory.
  • run the unZip for the uniserver package into the chosen . A will be created, but, standard Windows install with registry is not used by the UniServer package. (The name of the server_subdirectory changes with version, so I will call that )
  • Create a shortcut on your desktop to /UniController.exe. This will be your access to the UniServer control panel.

You are now ready to move on to the hard part … installing and configuring Eclipse PDT.

Head on over to the next article to find details of the Eclipse PDT installation and configuration.

Google Maps: Missing Zoom Controls

Previously, I entered a blog about an error with zoom controls for the Google Map. In that articles, the zoom controls were distorted when used in WordPress. Today, I found a second problem with the zoom control for Google Maps.

Today, I experienced the complete absence of the zoom control on a Google Map. The Google Map code was configured correctly to display the zoom controls. If you hovered your mouse over the location the zoom controls should appear, the cursor changed, implying that there were zoom buttons under the cursor. However, there were no buttons displayed.

Researching the problem, I found there was a very simple solution the problem. Add the following to the CSS:


  .gmnoprint img {
      max-width: none; 
  }

Add this simple CSS and voila, the buttons suddenly appear.

Google Maps Info Box, replace InfoWindow

Are you tired of not being able to style your info window correctly in Google Maps? There is a way to correct that problem. Replace your InfoWindow with an infoBox.

If you would like to have styling friendly popup boxes for your Google Maps markers, you need the following links:

To use the InfoBox:

  1. Include the infobox.js library
  2. Use new InfoBox instead of new InfoWindow.

It is easy, quick, and great for offering a more configurable popup window in Google Maps.

Google Map Markers with Labels

Google Map has a nice support library that allows you to create markers with labels attached. This is nice to let the map visitor have a quick idea what the pins on a map represents. You can make your labels simply digits to number the pins, alpha characters to index the pins, or add a short word or phrase to each pin. Very nice.

If you are looking to add labels to your markers on a Google Map, the following links are important to you:

Use of the library is simple, simply:

  1. Include the markerwithlabel.js library
  2. Make a marker using “new markerwithlabel” (see the example page link above)
  3. QED

Note, the new MarkerWithLabel allows you to add a few new parameters that define the label. Simply replace the old “new marker” declaration with a declaration of the following format:

     var marker = new MarkerWithLabel({
       position: homeLatLng,
       draggable: true,
       raiseOnDrag: true,
       map: map,
       labelContent: "$425K",
       labelAnchor: new google.maps.Point(22, 0),
       labelClass: "labels", // the CSS class for the label
       labelStyle: {opacity: 0.75}
     });

It’s great, use it.

Set up A Drupal Events Calendar with Recurring Dates

Do you need an event calendar that may need recurring events? I needed a calendar, installed calendar, loaded a bunch of events, then hit the need for recurring events. OOPS. Not supported. I had to go in, reload the calendar handling and reload the data. Boo. Well, for those of you needing a calendar with recurring events, here is what you need to do.
1. Download the three modules Ctools, Views, & Date. Install and activate the modules. Note: the Date module requires that you set the timezone and first day of the week settings. If you haven’t, it should alert you when you install the modules. Make certain you activate Date components Date Repeat API, Date Repeat Field, and Data Tools. You may also want to activate Date Popup if you want to use a popup calendar to help load dates.
2. Click on Structure > Views, and you’ll see what the Calendar module has done. You can see it has created a “Calendar” view. This calendar view includes a block, a feed, and a page. Don’t use it yet. Don’t run off and use the calendar until you follow the next step.
3. Go to Structure > Date Tools to create a calendar item. It will create a bunch of views, the correct content type, etc. Follow the date wizard to setup your calendar. Make sure you change the Content Type name, the default label “Date,” is just too ambiguous when looking to create a event. I suggest using the name “Event” as the name for the Content Type.

Some recommended settings and things to remember.
• In the “Date Field” section, select the correct option for “show repeating date options”. Changing this later creates problems. Also, decide now whether or not you want repeating dates. Select to allow repeating dates doesn’t hurt and protects you for later.
• In “Advanced Options”, confirm the way you want this calendar to handle the timezone.
• Select “yes” for “create a calendar for this date field”.
• And, you’re ready to go! If you go to “Add Content” you’ll see your brand new “Event” content type.

The calendar tool is fairly basic in this module, but you’ll see it has quite amazing recurrence features, which is nice.