FastCGI: incomplete headers (0 bytes) received

Hi there,

I currently use Gallery 2 for one of my websites on pinto. I have implemented PHP FastCGI according to the instructions provided on the wiki ( The site is working properly however I am unable to access the “Site Admin” nor upload files via Gallery Remote (specifically using a plugin called iPhoto2Galllery). Every single time I do, I get

[Wed Apr 25 01:52:18 2007] [error] [client] (32)Broken pipe: FastCGI: comm with server “/home/.petja/vandoornfamily/” aborted: write failed
[Wed Apr 25 01:52:27 2007] [error] [client] FastCGI: incomplete headers (0 bytes) received from server “/home/.petja/vandoornfamily/”

When I get rid of php-fcgi, it all starts working correctly again (although the page seems much slower).

My Gallery2 settings:
Gallery version = 2.2.1 core
PHP version = 5.2.1 cgi-fcgi
Webserver = Apache/2.0.54 (Unix) PHP/4.4.4 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
Database = mysqlt 5.0.24a-standard-log, lock.system=database
Toolkits = ArchiveUpload, Exif, ImageMagick, NetPBM, SquareThumb, Thumbnail, Gd, Getid3, LinkItemToolkit
Acceleration = partial/900, partial/900
Operating system = Linux pinto 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv: Gecko/20070309 Firefox/
Rows in GalleryAccessMap table = 484
Rows in GalleryAccessSubscriberMap table = 1075
Rows in GalleryUser table = 3
Rows in GalleryItem table = 1072
Rows in GalleryAlbumItem table = 35
Rows in GalleryCacheMap table = 2543

Right now I am running it without fastcgi, but I’d like to use it in the future or is there just no way?

For starters, you might want to try changing your ‘php5-wrapper.fcgi’ script’s name to: ‘dispatch.fcgi’

If that doesn’t work… then I’m quite stumped myself.

I had the same problem trying to set up ruby on rails. The problem is most likely you’ve got dos newlines in the shebang, at least thats what it was for me. Try running dos2unix on php5-wrapper.fcgi. I’ve got a bit more detailed info at my blog, but its more specific to RoR.