Tracking down header error

Hey guys, I’m after some advice on how to track down an error I am currently having.

On my local test box (Darwin 8.11.0 on PPC, apache 2.2.9, php 5.2.6 (apache module)) I have created a form using the Zend framework (1.6). This loads/posts/processes fine with no errors or warnings whatsoever.

I then rsync this to my dreamhost account (hosted on niagara). The form then loads correctly but when the form is submitted the server comes back with a http 500 error and the only error in the logs is “Premature end of script headers: php5.cgi…”.

I can however suppress this error by re-initializing the form object in my script, the problem with this is that it then does not redisplay values entered into the form. The bit that is really confusing me is the script uses the exact same files to process and redisplay as it does it initially display, so I know the script can access all the files it needs to.
I have had a look and all the relevant files seem to have the right permissions. They only real difference I can find between my development box and the dreamhost server is I am running php as a apache module rather than as cgi.

Does anyone have any idea on where I would start looking to fix this?


Well, of course it is really hard without the code, but to my way of thinking, the best starting place is with the differences in your environment.

You already know of one pretty major difference, PHP-CGI vs mod_php, but comparing the two environments’ phpinfo() output is where I usually start with such troubleshooting.

Things like register_global, and others, can be relevant - that’s where I would check. From your description of the behavior, I would guess it quite likely one of the differences you find may be relevant.

–DreamHost Tech Support