FCGId - Internal Server Error when executing PHP [SOLVED]

Hi,

I have a freshly installed Debian squeeze with Virtualmin 3.96 GPL and I have a problem with using the FCGId. When I try to execute any PHP on my virtual web server I got the Internal Server Error.

The error.log tells me:
[Sun Dec 16 21:59:05 2012] [warn] [client 91.119.204.181] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sun Dec 16 21:59:05 2012] [error] [client 91.119.204.181] Premature end of script headers: info.php

I have already done the steps described on https://www.virtualmin.com/node/20667 with the permissions, but I had no luck.

With CGI wrapper it does also not work. :frowning:

The strange thing is that it does not work over my domain, but it works if I use just the IP address of my server and the path to the file. That is weird for me.

Have you an idea what this can be?

regards
Christian

Howdy,

What errors do you see in the logs while using the CGI PHP Execution Mode?

CGI often offers better error messages :slight_smile:

-Eric

I got following in error.log:

[Sun Dec 16 23:26:09 2012] [error] [client 91.119.204.181] Premature end of script headers: php5.cgi

regards christian

Howdy,

Hmm, I’m curious what we see if you were to create a test.php script with the following contents:

<?php phpinfo(); ?>

And then access that test.php script from your browser… do you get the phpinfo() output? Or do you get that same script error?

-Eric

Here is the beginning of the output for the “normal” php mode. in other modes the same error appears.

PHP Version 5.3.3-7+squeeze14

System Linux Debian-60-squeeze-64-LAMP 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64
Build Date Aug 6 2012 14:04:31
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5/apache2
Loaded Configuration File /etc/php5/apache2/php.ini
Scan this dir for additional .ini files /etc/php5/apache2/conf.d
Additional .ini files parsed /etc/php5/apache2/conf.d/gd.ini, /etc/php5/apache2/conf.d/mcrypt.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/suhosin.ini
PHP API 20090626
PHP Extension 20090626
Zend Extension 220090626
Zend Extension Build API220090626,NTS
PHP Extension Build API20090626,NTS
Debug Build no
Thread Safety disabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters zlib., bzip2., convert.iconv., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, mcrypt., mdecrypt.

should I look for some other configuration files for more information?

regards,
Christian

Is there by chance a .htaccess file in your public_html directory?

If so, what are it’s contents?

It sounds like something is forcing mod_php mode to be used, even when FCGID/CGI is enabled. If it’s not in a .htaccess file, it’s likely a config option in your global Apache settings somewhere.

However, just to get things up and running, you could try commenting out this line in your Apache VirtualHost config block:

php_admin_value engine Off

Is there by chance a .htaccess file in your public_html directory?
no there is no .htaccess there only the info.php with the phpinfo command in it.

However, just to get things up and running, you could try commenting out this line in your Apache VirtualHost config block:
php_admin_value engine Off

have done this and restarted apache, but without success. :frowning:

I still have this issue with the internal server error when I use CGI or FCGId
So I would like to know if maybe the Virtualmin Pro version has a better support for that feature? I have read such comments in the forum.

The other option is to reinstall the complete virtualmin with the install script.

Any suggestions?

greetings from Vienna,
Christian

I decided to reinstall the complete debian 6 server and then I stated the install script from the command line. Now the problems with the FCGId are solved.

Merry X-Mas
Christian

I’m glad you got it working!

I did want to clarify that there’s no difference in FCGID support between Virtualmin Pro and GPL, they both interface with FCGID in the same way.

-Eric