Image: Hands on XAMPP
XAMPP has all you need to run Apache, MySQL and PHP on Windows

Hands on: Debugging PHP on Windows

How to use Eclipse to debug your PHP scripts on Windows

Written by Tim Anderson, Personal Computer World

PHP is a great web development language, but it can be awkward to test and debug. Unlike ASP.Net and Visual Studio, there’s no standard PHP IDE, and developers take a variety of approaches.

The old trick of using functions such as echo or var_dump, to output current values to the browser for testing, still works, but it is more arduous than using a proper debugger, especially when you need to trace a complex execution path.

It is worth setting up a PHP debugging environment on your own machine, though, so you can develop and test in convenience and safety.

Advertisement

The option I’ve picked for this tutorial is Eclipse, the free tools platform best known as a Java IDE. Eclipse has a huge range of add-ons, one of which is the PHP Developer Tools project. Eclipse is not the whole answer, though. To set this up, you need Wamp (Windows, Apache, MySQL, PHP), a PHP debugger and Eclipse.

Preparation
There are a few tools that are useful for working with Linux or Mac files on Windows. When extracting archives, the tool that is built into Windows sometimes has problems with Unix archives and doesn’t support all the formats you might need. However, Grab 7-Zip works perfectly.

Another annoyance comes when you try editing Linux text configuration files in Notepad. Windows has another way of dealing with line endings and runs all the text together. Install Notepad++ or another suitable editor.

Java
Eclipse won’t run without Java, and it makes sense to get the official Sun version. Eclipse recommends a Java 5 JRE (Java Runtime Environment), but in my tests, the latest version 6 worked fine.

Reader comments

More from Computeractive

News

The latest home computing news

Downloads

The best PC tools, applications and more

Reviews

Independent opinions on new hardware and software

Step-by-step guides

Easy-to-follow projects with pictures

PC Help

Solve PC problems with our Q&A

Videos

PC projects demonstrated and product reviews

Articles

An in-depth look at how to get the best from your PC

Magazine

What's coming up in Computeractive

Forums

Get help with your PC problems from our readers

Competitions

Your chance to win computing prizes

Shopping

Great deals on products, services and more

Computeractive Back Issue CD-Rom 12
All 26 issues of Computeractive from 2009 on one CD-Rom.

Ultimate Guide to Free Computing
Find out how you can get free software, services and more!

Learn to use Windows 7
Learn to use Windows 7
Everything you need to know about using Windows 7!

Computeractive - Issue 280Computeractive Back Issues
Missed an issue? Click here to find a back issue

Blogs

Windows Watch

Windows Watch

Keeping an eye on the latest XP and Vista news

Norton Smartphone Security for Android: First Photos

Exclusive first photos of Symantec's Smartphone Security for Android, taken at Symantec's headquarters. Story here .

Download Junkie

Download Junkie

Your daily dose of download discussion

Browse the web wherever you are with Firefox Portable

If you regularly use the Internet for work, you'll probably have a selection of tools you use on a daily basis to...

Advertisement

Free email newsletters

Techno babble demystified...

[Display all definitions]

Or type in any computer-related word and click "Go"

Advertisement

Computeractive is not reponsible for content of Google adverts

Primary Navigation

© Incisive Media Investments Limited 2010, Published by Incisive Financial Publishing Limited, Haymarket House, 28-29 Haymarket, London SW1Y 4RX, are companies registered in England and Wales with company registration numbers 04252091 & 04252093

Search computeractive.co.uk
opfine.com - markets sentiment analysis