My Perfect Mac-Eclipse-PHP-Subversion development setup
Eclipse is a truly great piece of software. Anyone developing with PHP (or many other languages for that matter) should consider it as a serious option for an IDE. And like a lot of great software, it’s free.
I use it most:
- For PHP/HTML/CSS
- On my Mac
- With Subversion
If that’s you too, then I have one or two tips for getting things running smoothly. Most of this will be helpful if you use Linux or Windows too.
Step 1 - Download and install EasyEclipse for LAMP
EasyEclipse is a set of great distributions pre-configured with plugins for specific types of development. Eclipse actually has a very easy to use plugins system, but EasyEclipse makes getting up and running even quicker.
» Download EasyEclipse for LAMP
Step 2 - Set up your development environment
When developing in a team using Subversion (or other version control software), you normally need a local development environment to test your work before committing it to the repository. I have had great success using MAMP. It’s a simple Mac package that installs Apache, MySQL and PHP in one go. You get a neat little utility to start and stop the services, easily change the document root and so on. Another similar package that’s available for PC too is XAMPP, which is also very good.
» Download MAMP
» Download XAMPP
XAMPP is more feature rich, but MAMP has been around on Macs a bit longer - It’s bit more stable and easier to use if you are using a Mac.
Step 3 - Eclipse setup - Welcome Screen
Fire up Eclipse. For some rather odd reason, Eclipse has a random, sort of surreal startup screen the first time you run it. This caused me to ditch using it the first time I experimented with it, as I didn’t have much time or patience at that specific moment to work out what it was. And once you have closed it that single first time, there doesn’t appear to be any obvious way of getting it back ever - so it seems kind of pointless.

Click the small cross next to ‘Welcome’ at the top, and you will see a familiar looking IDE layout.
Eclipse has a very well thought out (although a little bulky) windowing system. It uses the initially confusing terminolgy ‘views’ and ‘perspectives’. The ‘views’ are the panels, or little dockable windows. The perspectives are pre-defined layouts of views for pre-configured for specific types of tasks - such as PHP Web Development.
If you mess your windows up or get lost, simply do the following:
Window Menu > Open Perspective > Other
Select ‘PHP‘ from the list and click ‘OK‘. Everything should be back to near normality.
Step 4 - Eclipse setup - Turn off some annoying features, turn on some great ones
A lot of this is down to personal taste, but I think I’m fairly typical of an ex-Dreamweaver-code-view-will-do developer who’s learnt the error of his ways. So my preferences might be good for you if you fall in to that category. At the very least it will show you how to find the right options (and Eclipse has loads of ‘em)
To get to the Eclipse preferences, choose ‘Preferences‘ from the ‘Window‘ menu.
Because Eclipse has so many options, they have a really neat search feature that allows you to keyword search for the specific options you want. So type ‘PHP‘ in the ‘type filter text‘ box to get the options specific to PHP.

Each node in the list has a different page of options. Here’s what I normally change on a new install. With the PHP node selected:
- On the ‘Appearance‘ tab, I select ‘show line numbers‘
- On the ‘Typing‘ tab, I switch off ‘Wrap double quoted PHP strings‘, ‘Wrap singe quoted PHP strings‘, ‘Close double quoted strings‘, ‘Close single quoted strings‘, ‘Close brackets and parenthesis‘ (they might be good features when you get used to them, but I gave it a good go and in the end decided they are just annoying)
Step 5 - Create projects - Import your sites
- In the ‘File‘ menu, choose New > Project.
- Select SVN > Checkout Projects from SVN, click next.
- Choose ‘Create a new repository location‘, click next.
- Type the URL of your Subversion repository, click next.
- Enter your login details and choose the folder you want to check out. Click next.
- Important: Choose the option ‘Check out as a project configured using the New Project Wizard‘ (the default). This way Eclipse will send you to the new PHP project wizard next, which is really handy. Click finish.
- Choose PHP > PHP Project from the list and click next.
- Choose a location for the files to be stored. I usually work with the default ~/workspace (so set your document roots in MAMP/XAMPP to the directories in this location). Click Finish.
You should see your files in a window called ‘Navigation‘ on the left. If you right click on a file, the Subversion options are all in a sub menu called ‘Team‘
That’s all folks, I’ll leave the rest up to you. Post comments if you have any questions or corrections and I’ll try to answer them.






You can get back to the Eclipse startup screen by going to Help->Welcome on the top-line menu (or by clicking on the “return to welcome” icon in the mini toolbar at the bottom right of the window, if you minimised it rather than closing it). It’s not entirely pointless, as the welcome screen (and its minimised version in the bottom-right toolbar) gives access to the tutorials, code samples and program updates as well as the workbench. But it is a rather surreal way of doing it!
Hi,
It’s was very useful for me
just want to say thanks for this post
EasyEclipse seems to be set up to work with XAMPP rather than MAMP. Do I need to change any of the PHP Preferences in Eclipse to get it to recognize the MAMP server?
Thanks!