When it comes to PHP, it's a different kind of magical beast compared to strongly-typed programming languages like C#. PHP is more like javascript than C#. While porting partuza to .NET, I thought I could live without needing to debug through PHP. In the end, I decided, it probably will be easier if I could debug it.
Initially, I tried PHPEclipse, which is a plugin for Eclipse. However, for the life of me, I can't seem to get debugging to work and there wasn't much documentation out there on this particular setup. There had to be faster way. In the end I decided to give Zend Studio a look see. With some help, I managed to get debugging to work and i thought the following may be useful for someone new to PHP. The following is based on my experience getting debugging to work with partuza under Windows Vista.
The setup
Software packages
- WAMP 2.0
- Zend Studio for Eclipse
Procedure
- The initial configuration and setup for both partuza and shindig is based on these articles.
- Create a new PHP project in Zend studio.
- Next go, File .. Import ... and select File System

and import the partuza directory into the partuza project that was just created.

- Create a new PHP Web Page debug configuration as follows

- Before clicking ok, click on "Configure ... " and update the URL as follows

- Add a new file called dummy.php into /html directory in Zend Studio, the file should contain the following code
<?php
@ini_set('zend_monitor.enable', 0);
if(@function_exists('output_cache_disable')) {
@output_cache_disable();
}
if(isset($_GET['debugger_connect']) && $_GET['debugger_connect'] == 1) {
if(function_exists('debugger_connect')) {
debugger_connect();
exit();
} else {
echo "No connector is installed.";
}
}
?>
- Next php.ini will need to be modified. If you had followed the configuration steps in the article above, the php.ini will be located at http://www.chabotc.com/generic/setting-up-shindig-and-partuza-on-windows/. From WAMP, you can directly configure this php.ini. If you are not sure which php.ini you need to configure, create a php file called phpinfo.php under /html in your partuza directory (same directory with index.php, config.php etc), containing <?php phpinfo(); ?>.This will enable you to goto http://partuza/phpinfo.php and find out which php.ini is currently in use.

- Add the following to your php.ini
zend_extension_ts="C:\Program Files\Zend\Zend Studio for Eclipse - 6.1.0\plugins\org.zend.php.debug.debugger.win32.x86_5.2.14.v20080602\resources\php5\ZendDebugger.dll"
zend_debugger.allow_hosts=127.0.0.1/32,192.168.1.0/16
zend_debugger.expose_remotely=always
Update zend_extension_ts to point to the location of your ZendDebugger.dll and point the allow_hosts ip addresses to the ip address of the partuza server. Also the following options should be set to
output_buffering = 0
implicit_flush = On
- Next, Apache needs to be configured. Both httpd.conf and httpd-vhosts.conf are configured as follows
httpd.conf (C:\wamp\bin\apache\apache2.2.8\conf)
Update DocumentRoot and Directory to point to your Zend workspace where the partuza
was created like shown below

httpd-vhosts.conf (C:\wamp\bin\apache\apache2.2.8\conf\extra)
Update the partuza virtual host configuration as shown below to update the DocumentRoot as well

- Restart your apache server.
- Go back to the debug configuration that was created earlier, click on "Test debugger" and it should give you "Success!".
- Hit "Debug" and the debugger should start and break in "index.php".
And that's it. Hopefully, I did not miss anything. :)