views:

544

answers:

3

I'm starting to move some sites to WordPress hosted in IIS7 using PHP 5.3 & FastCGI. I'm quickly finding that while the core of WordPress seems to work just fine out of the box, there are a number of plugins that have issues running in IIS and I'd like to be able to debug them, fix them, and submit patches.

The only solution I've found is to run WordPress in Apache on Windows to debug, but the issues appear to be related to how IIS & FastCGI work with PHP and not so much from being on Windows. I've looked at both Expression Web 3 and Aptana Studio 1.5 but could not find a way to do this with either tool.

Is there any ways to debug WordPress (or PHP in general) running under FastCGI on IIS7? What tools are needed, and specific steps would be appreciated.

A: 

I've debugged alot of PHP on windows and never had that much of a problem, it would help to know what you are trying to use to debug things and what errors you are running into. Generally the errors you might have are stuff to do with Apache functions and/or presumptions made about $_SERVER[].

Anyhow, given FastCGI likely isn't the problem, I would setup the dev environment to run as normal CGI which should be a bit easier for the debugger to access.

Wyatt Barnett
The main issue is that I haven't found any way to debug PHP in IIS as opposed to Apache. I agree with your thoughts on where errors are likely coming from, which is why I want to be able to debug under IIS rather than Apache so that I can accurately see what's going on.
John Clayton
What are you using to try and debug PHP in the first place? Last time I tried, I had no problem using [whatever I was using at the time, I think PHPEdit] and doing live debugging locally via IIS and PHP running over CGI.
Wyatt Barnett
I've tried Expression Web 3 and Aptana Studio 1.5 but couldn't figure out how to debug PHP in IIS. I'm not even sure what you'd attach to, w3wp.exe or php-cgi.exe?
John Clayton
Hmm, can't say I've used either package. Most of the stuff I used was based off the old phpdbg library (http://www.php-debugger.com/dbg/)
Wyatt Barnett
A: 

I would suggest doing a phpinfo() and pasting the output here that's XDebug a very good debugger with Windows binaries on their site. Now whatever editor you're using needs to support xdebug in order to have that step-by-step thing.

Also you should look at FirePHP which is a plug-in for Firebug in Firefox. It's sort of in between the print_r(); and xdebug or...

Finally look at dbg which will also work on windows. In this post there is some configuration information for IIS, just ignore the stuff about VS.php.

Hope all that helps.

John Swaringen
A: 

XDebug is a very very good tool for debugging PHP.

If you are using an IDE like Netbeans, XDebug allows you to run your PHP code on a local server in step-through mode, with break points and variable watches. Very very powerful and extremely easy to use.

Spudley