Monday, February 08, 2010

Setting up PHP and Eclipse IDE for debugging on IIS7.

Here are the steps required to setup PHP on IIS7 and configure Eclipse IDE for debugging:
1. To install PHP on IIS7 you can either download the PHP installer from http://php.net/downloads.php or use Microsoft Web Platform installer. If you are installing PHP directly without using Microsoft Web Platform installer make sure you install the non thread safe version. The web installer automatically install the correct version. Also, on the window to select the web server, select IIS FastCGI.
2. Download and install Eclipse for PHP developers from http://www.eclipse.org/downloads/
3. Download and copy the non thread safe version of Zenddebugger.dll (from 5_2_x_nts_comp folder) into ext folder of PHP install directory.
4. Include the following at the end of PHP.ini file in the PHP install directory
[Zend]
zend_extension="C:/Program Files/PHP/ext/ZendDebugger.dll"
zend_debugger.allow_hosts="localhost,127.0.0.1"
zend_debugger.expose_remotely=always
zend_debugger.connector_port=9009
5. Now open Eclipse and select Windows -> Preferences
6. On the preferences window select Debug under PHP. In the Default settings, select "Zend Debugger" from the dropdown and click on Configure link and enter 9009 next to Zend Debugger for the port. Next select the PHP servers link and enter the URL of the PHP web application (eg. http://localhost).

5 comments:

Klaus said...

Any luck getting xdebug to work with eclipse and IIS7.5 on Windows 7?
I will try your suggestion. Also looking at the download directory for the zend debugging files I was wondering whether the dlls require any kind of cygwin files on your computer. Isn't cygwin a unix emulator?

Thanks for sharing this.

Klaus

Piers Lawson said...

Fantastic information! I've spent 1/2 a day trying to get IIS7.5, PHP (installed via the Web Platform Installer), Eclipse and the Zand debugger to play nicely together... and now it does. Just in case anybody else is wondering... yes that is IIS7.5 as I'm doing this on Windows 7. Thanks again!

Piers

Owen said...

brilliant. that worked perfectly. thanks

Deepak said...

This is Cool... Working for Me..

clod said...

Codelobster works best for me with IIS