Image: Hands on XAMPP
XAMPP has all you need to run Apache, MySQL and PHP on Windows
R E L A T E D   C O N T E N T
ADVERTISEMENT

Hands on: Debugging PHP on Windows

How to use Eclipse to debug your PHP scripts on Windows

Tim Anderson, Personal Computer World 03 Nov 2008
ADVERTISEMENT

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.

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.


All Software Applications
Tags: Visual-programming

Like this story? Spread the news by clicking below:

Post this to Delicious del.icio.us    Post this to Digg Digg this    Post this to reddit reddit!

Permalink for this story
R E A D E R   C O M M E N T S
M A R K E T P L A C E
Get your free demo of Numara Track-It! 8 - the leading help desk solution for IT related issues.
Make presentations, review documents & share your entire desktop. 30-day free trial! (cc required).
Discover how remote support can fuel your IT business in ways you've never thought of before.
Apply ITIL best practices at your service desk while eliminating integration cost. Learn more here.
WAN based, automated, daily vulnerability assessments. Click here to try and request our whitepapers.
Have your product or service listed here >   
Sponsored links
F E A T U R E D   J O B S
| Computer People
Java Developer –J2EE/UML/Oracle –Ascot -£42,000 Key Skills: Java, J2EE, Oracle, SQL Server, DB2, UML, Hibernate, JBOSS and Websphere. My client is a leading independent software vendor in a period of continued expansion. They require a ... more >
| Computer People
Performance Test Analyst –Automated/Web/SQL –Leeds -£30k Key Skills: Performance Test Analyst, Automated Test Analyst, Functional Testing, Web, Software, SQL, SQL Server, IIS. My client are a leading services organisation in a period of continued growth. ... more >
| Computer People
Systems Analyst –Agile/.Net –Leeds -£30k Key Skills: Systems Analyst, Systems Analysis, Agile, .Net, Change Delivery, Analysis, Implementation, Development. My client is a leading services organisation who are expanding there is function. The Systems Analyst will ... more >
| Computer People
Application Support Analyst -2nd Line/SQL Server/IIS -£35k –London Key Skills: Application Support, Software Support, Product Support, SQL Server 2000/2005/2008, VBA and IIS. My client is a leading Vendor in the process of expanding their support ... more >
More job opportunities