FCGI Problem

I am having a problem with FCGI.

When I try and run index.php as a FCGI script I get a 500 error. Does anybody see anything obviously wrong here?



This is a test!


$value = $value + 1;

echo “

Value is “.$value.”



#Everything rem’d out works (plain old Apache)

#Lighttpd works
#AddType application/x-httpd-php .php

#FCGI no worky
#Options +ExecCGI
#AddHandler fastcgi-script fcg fcgi fpl
#AddHandler php5-fastcgi .php
#Action php5-fastcgi /php5-wrapper.fcgi

Note I have rem’d everything out to make sure it works. If I unrem the
lighttp section it works. If I unrem the #FCGI section it doesn’t work.

The wiki article says:

AddHandler fastcgi-script fcg fcgi fpl

when I think it should be this:

AddHandler fastcgi-script .fcg .fcgi .fpl

…or maybe it doesn’t matter, either way it doesn’t work.

exec /dh/cgi-system/php5.cgi

I have done this test exactly to the dreamhost wiki as far as I can tell. There has to be something else wrong.


Did you close your eyes and wish really hard that it would work? I’ve found that fixes about half the problems I have here.

The first time I set up FastCGI, I had the same problem as you. Double-checked my typing, made sure all my permissons were set correctly, and so on. Decided to call it a night and work on it the next day, and the following morning it auto-magically worked without changing a thing.

I guess the moral of the story is: sometimes it’s not you that’s the problem. Although it could be. I don’t see any problems with what you posted, but maybe a more perceptive person will find a mistake there.

Edit: Upon examining my current setup, it looks like I included the dots in the AddHandler line. Don’t know if it makes a difference or not:

AddHandler fastcgi-script .fcg .fcgi .fpl

You might also take a look at your error log for apache as well. In fact, if you could post a couple lines of output from there, it might help a bit.

However, php5-wrapper.fcgi needs to look like this:

The .fcg .fcgi .fpl I’m not sure really matters… but I guess it’s also worth a shot.

You might also try recompiling, if you went with the custom PHP route, PHP5 to support pear (So remove the –without-pear line from the install script).
FCGI works nicely for me like that.

Hi Mousee,

Thanks for the reply. Here are a couple lines from my error log.

[Thu Jan 25 12:27:40 2007] [error] [client] FastCGI: comm with (dynamic) server “/home/vortex996/vortexsedona.com/php5-wrapper.fcgi” aborted: (first read) idle timeout (60 sec)
[Thu Jan 25 12:27:40 2007] [error] [client] FastCGI: incomplete headers (0 bytes) received from server “/home/vortex996/vortexsedona.com/php5-wrapper.fcgi”

I tried what you suggested. That must have not been it.

Interestingly some search engine is already looking for robots.txt. My broke test site has been up for like two days.


I am not using a custom compiled php…

It was CRLFs in my wrapper script. Anybody know of a good editor for XP that doesn’t use CRLFs?

DOH! Glad you got it figured out… cause I was out of ideas for you as well, heh.

In regards to editors, I’m not sure if you’ve tried Notepad++, but it would be something you’re looking for.
The Sourceforge page for it is here :slight_smile:

if you create a file on windows that has CRLF and then FTP it in ascii mode (which you should pretty much always do for text files), the CRLFs will get converted to LFs for you.

I am using FileZilla. If there is a setting for that it’s not on and I can’t find it.

just edit with pspad, and use the statusbar to select the cr/cf type

BUGabundo :o)
promo here
50$ discount with promo code “BUG50” on ALL plans