I had the same problem running:
WIN98
PWS
PHP 4.0.6 Windows Installer php.net
I first installed using c:\php
This gave me the cgi header error.
I then did a re-install using g:\inetpub\php
This worked great. I then deleted my original
c:\php directory which resulted in server errors.
I pulled the php directory back out of the Windows Trash and back to the c:\php location and all was well again.
My guess is that I need to change a directory path in php.ini to show the g:\inetpub\php location of the php*.dll
If anyone is interested I will let you know what fixed the problem when I get it fixed.
Charles