Error 500 & Premature end of script headers


I’ve a problem wiht several scripts on a server with this options:

PHP5, Apache2, Posgresql 8.1, on Centos 5.2 x64 running wiht FCGId.

One it’s a php script for Postgresql backup (pgdump) and another it’s a script for actiones with ImageMagic program (convert)

On all cases if site are on mode FCGId aplication fails an show 500 Internal Server Error.
If put this siste on mod_php, scripts running perfectly.

On errors_log show this on all cases with running how FCGId:

[code:1]Premature end of script headers:[/code:1]

On seconda case (ImageMagick) this error only if the work for ImageMagick program get a lot of files for processing. If number of files it’s minimun, script work perfectly.

On firts case, if databse it’s litlle, work fine.

I’ve modify time execution, but don’t work.

I’m lost.

It may be an suexec related problem (which mod_php does not use).

In the Apache logs directory in /var/log/httpd, there should be a file along the lines of suexec.log – does it have any info?

Suexec is fairly security conscious, and may have problems if the permissions are too relaxed, or if the file is not owned by the same user who owns the directory it resides in.

Also, if you run:

/usr/sbin/suexec -V

What is the value of "AP_DOC_ROOT"?