fcgid and cgi on centos 6.4

Hi there, I’m struggling to get fcgi or cgi working on a 1G vps with centos 6.4. I am in a situation where cpanel was once installed, but I’ve removed it and it seems ok. VPS provider doesnt seem to want to do a os reinstall, so im sort of stuck in this situation for now.

I’ve read through all the threads I could find and tried them all, but to no avail.

The funny thing is my logs are somewhat clean for suexec.

httpd error log:

[Sat Jul 13 08:22:36 2013] [warn] [client xxx.xxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jul 13 08:22:36 2013] [error] [client xxx.xxx] Premature end of script headers: index.php


[2013-07-13 08:22:36]: uid: (505/xxx) gid: (505/xxx) cmd: php5.fcgi

suexec info

root@server [/usr/sbin]# suexec -V
-D AP_DOC_ROOT="/home"
-D AP_HTTPD_USER=“apache”
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_USERDIR_SUFFIX=“public_html”
root@server [/usr/sbin]# stat -c %a suexec
root@server [/usr/sbin]# ls -al suexec
-r-s–x— 1 root apache 29520 May 17 22:43 suexec*
root@server [/usr/sbin]#

Any help or direction would be appreciated



The suexec information all looks good… but that Apache error doesn’t :slight_smile:

If you change the PHP Execution Mode to CGI, what error(s) do you receive in the Apache log at that point?


Thanks Eric, here is the output:

[Tue Jul 16 12:45:50 2013] [error] [client xxx.xxx] Premature end of script headers: php5.cgi

Nuts! I was hoping for a more descriptive error message :slight_smile:

What happens if you create a new PHP script named “test.php”, and for it’s comments, add the following line:

<?php phpinfo(); ?>

If you access that test.php script in your browser, do you receive the PHP info output? Or does it throw that same error you’ve been getting?