Patrick J Waters

  • sites
  • mobile
  • résumé
  • about
  • contact
  • blog

Home

How to setup Eclipse with PHP PDT, Remote System Explorer, Theme Manager, and Drupal Plugins

patrick — Sun, 07/24/2011 - 21:55

Recently I decided to package eclipse pre configured with this tutorial and offer it for purchase. You can purchase it above, or you can run through the tutorial yourself, enjoy! If you decide to purchase you will have to make sure you still do step 8, there is no way for me to package that.

Update...this configuration still works with Eclipse Juno.

We all know that Eclipse works great with java, but I have always wanted to use it with PHP and more importantly for developing with Drupal. I've tried so many times to get it to work in the past with something always not working right. I finally have figured out a nice smooth setup for using PHP, Eclipse, and Remote System Explorer, and Drupal. Also with an added bonus of the Theme Manager plugin.

One of the challeges that I faced was that I sometimes want to do work on remote servers and I never knew how to do that with Eclipse. Remote System Explorer plugin was the answer to that. It's a very nice plugin once you get use to it. You can have multiple connections setup to multiple servers and easily navigate all of them at once. Remote System also allows you to browse the local file system. Remote System basically lets you break out of the Eclipse 'project' mentality and use it more as a hgh powered text editor. 

Alright well on to the tutorial. Please follow these step by step instruction to get it all working. Should only take about 10mins to set it up.

I set this up on Mac OSX 10.6, but this setup should work for windows and linux as well. If you have trouble on windows or linux, please leave a comment and I will investigate.

Step 1: Download and Install Eclipse

Go to http://www.eclipse.org/download and download 'Eclipse Classic' (Don't download Eclipse PHP package), at the time of writing this Indigo (3.7) was the most current release.

Once downloaded, un tar ball/unzip and install Eclipse.

Next start up eclipse and choose your workspace folder.

Step 2: Settings up PHP PDT Plugin

Alright once you have Eclipse up and running, your going to want to navigate to 'Help > Install New Software'. 

This will bring you to a screen like so 

If you look twords the top of that window you will see a drop down that says 'Wok With', click that and select '--All Available Sites--'.

Next you are going to want to search for 'PHP', this will list the same plugin in three different categories. Just select the first one that says 'PHP Development Tools (PDT)...' and then click 'Next' and run though the install process. Its is pretty straight forward. It will ask you to restart Eclipse click 'Restart Now'. Thats it you now have the PHP PDT plugin installed. This plugin by its self is not super useful because of the way the it is encased in Exlipses 'project' mentality.

From here on out when ever I say go and install new software, you should follow these steps.

Step 3: Install Remote System

You are going to follow the same instruction as above, but you are going to search for 'Remote System', remeber to select '--All Available Sites--' in the 'work with' drop down. Click 'Remote System Explorer End-User Runtime' and 'Remote System Explorer User Actions' and run through the install process like before.

 

Step 4: Install Theme Switcher (Optional)

The setup for the theme switch is same as the above EXCEPT next to the 'work with' drop down you will see a 'add' button, click that. Fill out the form and enter this as the 'Location':

http://eclipse-color-theme.github.com/update

click ok, and in the list of available plugins to install you should only see one choice 'Eclipse Color Theme'. Check the box and run through the install process, it may give you a warning about installing software from outside sources, just click ok and continue.

Once Eclipse Theme is install you can navigate to Ecplise Preference, on mac they are in 'Eclipse > Preferences', on windows I think they are in 'File > Preferences'.

This will open a window with tons of options. All I want you to be aware of at this point is under 'General > Appearance > Color Theme'. This was added by the theme plugin. Here you can change your theme to what ever you prefer.

 

Step 5: Install Drupal plugin (Optional)

I work a lot with the content management system Drupal and thought it would be nice to note that there is an Drupal Eclipse Plugin.

To install the plugin it is going to be similar to the theme plugin above. Navigate to 'Help > Install New Software' and add a new site like above and enter the location as:

http://xtnd.us/downloads/eclipse

Again after adding this new location you will be prompted with only once choice. Just select 'Drupal for Eclipse' and run though the setup.

 

Step 6: Configuring PHP

By defualt in Eclipse 3.7 and greater php file will not automatically open in Eclipse. 

Go to 'Eclipse >Preferences' (Mac) or 'File > Preferences'(Windows) and then go to 'general > editors > file associations'. 

click the add button on the left and enter '*.php' with out the quotes. 

 

After you hit ok you will see a list of editors below. Click on 'PHP Editor' and then click the default button on the right. And then click ok.

 

Step 7: Configuring Remote System Explorer

First thing you need to do is add the Remote System Explorer perspective to your eclipse workspace.

Go to 'Window > Open Perspective > Other'. now look for Remote System Explorer and add that.

Now you will have a new tab in your Eclipse workspace. By defualt you can browse and edit local files on your hard drive with RSE.

Now the fun part setting up a new conennection.Clcik the little down arrow in the 'Remote System' tab and select 'New Connection'

The next screen shows you all diffecent types of connection. I am going to walk through setting up a ssh connection. So on the next screen select 'SSh Only' and select Next.

the next screen you will need to enter in your host. I am not going to show a picture of this step.

Now you have a new connection in your 'Remote System' tab if you unfold it you will see 'My home' and 'Root'. By default RSE gives you these two file filters to choose from.

If you want to add another filter you want to right click on 'Sftp Files' and go to 'New > Filter'.

Next you will enter in the file location you would like to start from, like /home/test. Select next, give the filter and name and click ok.

Step 8: Fixing PHP autocomplete with Remote System Explorer

The last step is fixing the php autocomplete feature. To do this you are going to have edit a hidden file in your workspace folder. But first we are going to enable hidden files on RSE. Go to 'Eclipse > Preferences' (Mac) or 'File > Preferences' (Windows) and then unfold 'Remote Systems > Files'.

Check 'Show Hidden Files' and click ok.

Now we are going to use RSE to edit an eclipse RSE .project file. So in your 'Remote System' tab open up your local files and navigate to you workspace folder. Look for a folder called 'RemoteSystemsTempFiles' and open that. Now you are going to edit the '.project' file. Open up that file.

You are going to add two line in between the <natures> tag, those lines are 

<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature> 
 
 
Save that file and restart eclipse. If you did everything correctly you should now have auto complete that will look like so
 
 
 
 
Well thats it, you should now have a fully fuction Eclipse web developing enviornment. Hope you enjoyed it, let me know if you find any errors in my work.

 

 

 

  • drupal
  • Drupal-Planet
  • eclipse
  • how to
  • php
  • remote system explorer
  • Share this
  • Tweet

Thank you very much

Anonymous — Wed, 08/17/2011 - 06:26
now it works :-) Installed on OS Windows7
  • reply

Thanks!

Anonymous — Tue, 08/23/2011 - 05:56
Wow, I have been trying for hours to make Eclipse PDT autocomplete work for remote .php files just as it works in my project folders. And here it is! Thank you very much for this information! ;-)
  • reply

aaa

Anonymous — Sat, 09/03/2011 - 14:12
Wow awseome tutorial btw on Win its window->preferences not file captcha word -> rulez
  • reply

Didn't work for me. Eclipse

Anonymous — Wed, 09/14/2011 - 04:19
Didn't work for me. Eclipse Platform Version: 3.7.0 Build id: I20110613-1736 Ubuntu 11.04 x32 Any suggestions?
  • reply

Can you be more descriptive,

patrick — Wed, 09/14/2011 - 10:43

Can you be more descriptive, what doesnt work?

  • reply

Thanks

Anonymous — Tue, 09/20/2011 - 02:06
Brilliant! Very well written. Thank you.
  • reply

Another Thanks

Anonymous — Fri, 09/23/2011 - 11:52
Thanks a bunch, had stumbled through the first few steps on my own, but this made it so much easier! Thanks - bookmarking this for sure!
  • reply

I have been looking for a post like this for weeks

Anonymous — Mon, 10/17/2011 - 04:57
First of all, thank you very much for the post. Note: English is not my mother tongue so there might be some mistakes in the following text I tried to setup a remote connection on my server using Eclipse PDT and I downloaded some days ago, (Eclipse for PHP Developers Version: Helios Release Build id: 20100617-1415). Although you said that this only work with Eclipse Classic, I have seen a previous post from some one who has made it work with PDT. My problem appears> after I click next on the screen select 'SSH Only'. Eclipse tries to verify the server but something goes wrong. You said: the next screen you will need to enter in your host. I am not going to show a picture of this step But can you explain it in a generic way?, I mean on the screen: Remote SSH only system connection you have to fill up the following fields: Parent profile -> this is an input select, I suppose you have to set it up somewhere else Host name -> in my case only appears LOCALHOST (I suppose I should add a new configuration as well) The next fields (connection name and description) are not relevant. In Remote perspective there is a label called Team where you can create a new profile. I created new profile but I couldn't configure the server name, the username and password for accessing. Thanks in advance.
  • reply

update sites empty

Anonymous — Tue, 10/18/2011 - 08:05
where i can find default update sites for eclipse 3,7 ? i install eclispe from ubuntiu 11.10 and update sites is empty - can find in web default sites
  • reply

i found

Anonymous — Tue, 10/18/2011 - 08:19
repo is : (software sites for 3,7) http://download.eclipse.org/releases/indigo http://download.eclipse.org/eclipse/updates/3.7
  • reply

PDT version

Anonymous — Fri, 10/28/2011 - 01:49
Hi Patrick, thanks a lot for this post. I found code highlighting and code assist non working with Eclipse 1.3.7 and PDT 3.0.0. Did you install a previous version of PDT? Thank you!
  • reply

yes I am using pdt version

patrick — Sat, 10/29/2011 - 12:18
yes I am using pdt version 2...I will work on version 3
  • reply

Thank you!

Anonymous — Tue, 11/01/2011 - 08:02
Helped a lot.
  • reply

Fantastic!

Anonymous — Thu, 11/03/2011 - 01:52
Thanks for making an easy guide for this stuff. I simply can't believe how simple it turned out to be. Most lacking feature I've had for the last several years of Drupal development has been remote autocomplete. The theme is icing on the cake. Thanks again! Rather than using Eclipse to edit the .project file I used Terminal to find it and edit it directly. One thing weird about the autocomplete: drupal_add_js() is missing from the list :)
  • reply

Thank you!

Anonymous — Fri, 11/04/2011 - 13:58
Thank you for this post. It provided a huge frustration relief.
  • reply

Great!

Anonymous — Sat, 11/05/2011 - 12:44
finally I got php auto completion in RSE :)
  • reply

much appreciation

Anonymous — Fri, 11/25/2011 - 00:19
after 2 days spent of trying to figure out how to get eclipse working for php , I have to say following your instructions has finally gotten me some rest. I very much appreciate you taking the time to put this out there. thanks so much <3
  • reply

Thanks, but it would be

Anonymous — Mon, 12/12/2011 - 09:22
Thanks, but it would be better just to write where the .project file is and to edit it with normal editor. I searched the whole remote host for the .project, because the RSE part was confusing. Why use RSE for editing local files?
  • reply

That is your own mistake, RSE

Anonymous — Mon, 12/12/2011 - 12:45
That is your own mistake, RSE is one of the only way to open random local files using eclipse without having to make a project in eclipse.
  • reply

what about .php5 Extention?

Anonymous — Mon, 12/12/2011 - 11:39
any way making .php5 extension behave as .php with RSE? Thank you.
  • reply

Just go to ecliplse

Anonymous — Mon, 12/12/2011 - 12:47
Just go to ecliplse preferences > editors > file assciations and add .php5 to default to the php editor.
  • reply

Drupal PDT add-on feedback

Anonymous — Thu, 12/15/2011 - 16:35
Hi, this is Chris Charlton, the author of the Drupal plug-in for PDT. I am interested in hearing any feedback. The module available now was just a start and I have many featured slated for newer editions. http://www.eclipse.org/forums/index.php/m/559724/
  • reply

Default editor / Encoding

Anonymous — Mon, 12/19/2011 - 09:22
How can the default editor for remote files be set, and where the encoding? Works correctly for me with local files, not remote ones. Wondering why that is not a global setting for ALL files ...
  • reply

Default editor / Encoding

Anonymous — Mon, 04/02/2012 - 17:53
For the encoding part: In Eclipse, go to Preferences>General>Workspace and select the desired default encoding as the Text File Encoding. As far as the default editor for remote files in osme files it works and in some it doesn't. I have not yet figure out why. I am using eclipse 4.1.2.
  • reply

To be honest I have not been

patrick — Mon, 12/19/2011 - 09:27
To be honest I have not been able to figure that out.
  • reply

Default editor / Encoding

Anonymous — Mon, 12/19/2011 - 09:27
How can the default editor for remote files be set, and where the encoding? Works correctly for me with local files, not remote ones. Wondering why that is not a global setting for ALL files ...
  • reply

Missing ability to navigate between classes

Anonymous — Wed, 12/21/2011 - 03:57
After reading your guide I have auto-complete in my IDE, but I still don't have the ability to navigate between classes by holding the CTRL + CLICK action. On a Local ENV this is possible and it is a time saver. Is this possible on a SSH-ed ENV ?
  • reply

Resolved : Missing ability to navigate between classes

Anonymous — Thu, 12/22/2011 - 02:27
Hello, I just want to let you know that I solved this problem, and maybe let the answer out in the open for others. What i had to do was to RIGHT CLICK the project in the NAVIGATOR widget and select from the CONFIGURE item : ADD PHP SUPPORT.
  • reply

how do you debug the remote?

Anonymous — Tue, 12/27/2011 - 10:14
I have a remote system set up in "Remote Systems", but when i try to set up a project, there is no way to attach those remote files. if i try to set up a debug session, it looks like it either needs a set of local files or an actual project to debug. so how can i debug like this? i have tried a workaround that i don't like using, but works. using transmit for mac, i mount the SFTP connection as a drive, then connect the project to that drive. i don't like it because it gives the operating system and any other applications full access to write temp files and other garbage. but the point is that xdebug is working properly like this. it's just not working with the "Remote Systems"
  • reply

Thank You

Anonymous — Wed, 01/04/2012 - 01:59
This tutorial is invaluable. Thank you so much for creating it. My abilities are in writing code, not playing around with different plugins. You saved me so much time, I just had to take a minute to thank you. You rock.
  • reply

Code completion in RSE

Anonymous — Fri, 01/06/2012 - 08:30
Thank you! Finally working tutorial for PHP code completion.
  • reply

Does not work on my version

Anonymous — Fri, 01/06/2012 - 12:20
I'm using "Eclipse for PHP Developers", version "Helios Service Release 2", build id "20110301-1815". I followed your instruction on how to enable code completion for remote files (adding two lines between <natures> tag), but it does not work for me. Am I missing something?
  • reply

I use galieo, I have never

patrick — Tue, 05/08/2012 - 13:53
I use galieo, I have never really like Helios. Tended to be buggy and cause problems.
  • reply

It works beautifully!!

Anonymous — Sat, 01/28/2012 - 05:42
great! great! great! thanks a lot!
  • reply

Thank you

Anonymous — Thu, 02/02/2012 - 11:31
Been looking for a good "how-to" on setting up Eclipse on my Mac. Your post is spot on! Thanks for the very informative post.
  • reply

Seriously - Thank You

Anonymous — Sat, 02/04/2012 - 16:23
For someone not familiar with eclipse, it can be very frustrating setting up a decent PHP environment, and the all in one zend PDT I orignally attempted to use seemed very outdated and using Helios. Finding anything else to match was extremely difficult. I Finding this information was a lifesaver. Thank you.
  • reply

For Getting host-name under ssh (In Mac)

Anonymous — Sun, 02/05/2012 - 13:45
Just Open the terminal and give the command as- Apples-MacBook-Air:~ apple$ hostname OR You can change the host name with this command- sudo scutil --set HostName your_host_name.local
  • reply

very helpful

Anonymous — Mon, 02/06/2012 - 06:15
nice one!
  • reply

Helped Me so Much

Anonymous — Thu, 02/09/2012 - 07:38
I have been using Eclipse, Drupal and RSE for years now... but never have I brought them all together until now. Thanks! P.S. A good tutorial is one with additional tips/tricks i.e. Theme Switcher. Good Job!
  • reply

Tremendous Time Saver

Anonymous — Sun, 02/12/2012 - 17:10
To find the entire installation in one place was an enormous relief after hunting everywhere through all kinds of confusion. Thanks so much, Bob
  • reply

Shows Pending when click on work with -All availabe sites

Anonymous — Wed, 02/15/2012 - 01:46
At step 2, when I click on work with all websites. I get a button with pending... message. I need to set up PHP. Any help is greatly appreciated. Ron
  • reply

JDK & JRE

Anonymous — Wed, 02/29/2012 - 13:49
I had issues at this point. It turned out that I had to update my JDK and JRE. Also, much searching on the internet revealed that there are some issues when using the 64bit version. I changed everything to 32bit, updated my JDK and JRE and everything installed flawlessly. As a note, step 2 took a while due to the number of locations I had added when trying to get this to work. A little patience may be all you need. http://www.oracle.com/technetwork/java/javase/downloads/index.html
  • reply

Thanks. Worked like a charm!

Anonymous — Wed, 02/22/2012 - 16:50
Thanks. Worked like a charm!
  • reply

Thanks

Anonymous — Wed, 02/29/2012 - 16:09
Thanks now my life will be much easier :)
  • reply

MY GOD, thank you!

Anonymous — Fri, 03/02/2012 - 05:59
Dear goooood thank you so much for those nature tags. I have been trying to solve the code completion thing in RSE for AGES. And noone was able to give me a solution till I found this. Thank you sooooo much!
  • reply

Thank you!

Anonymous — Thu, 03/08/2012 - 13:50
Thank you so much! That's the clearest guide I've ever seen! Everything works like a charm.
  • reply

Reply to comment | Patrick J Waters

Anonymous — Sun, 07/08/2012 - 09:20
Your blog post about this topic is comfort and inspiration in my experience. A friend once informed me about some of the guidelines you share but I thought it was not proper because I had another type of opinion which had been kept with me for years. Using your article, I today know John ended up being right. I think I will send him a letter immediately. Probably include your website link as well. He too has to know more of the things people haveeveryone has learned from your write-up. Thanks Also visit my web site ... Eddy Cruthers
  • reply

Nice explanation

Anonymous — Tue, 04/03/2012 - 23:33
Nice explanation
  • reply

thank you

Anonymous — Mon, 04/23/2012 - 04:26
This was so helpful. I'm up and running. I would have never figured this out on my own. I really appreciate that you shared this with us.
  • reply

THANKS!!!

Anonymous — Tue, 05/01/2012 - 13:45
Than you so much! Great explanation and screen shots!
  • reply
  • 1
  • 2
  • 3
  • next ›
  • last »

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

patrick's tweets

  • Recent Project: Converting the BMJ (British Medical Journal) to Drupal http://t.co/6sTLhMFZ — 1 year 8 hours ago
  • Climate Change http://t.co/wuPwyIan — 1 year 21 weeks ago
see more
  • sites
  • mobile
  • résumé
  • about
  • contact
  • blog