I’m trying to port my Perl .cgi scripts to FastCgi (.fcgi), but they won’t run reliably. Sometimes they load in a browser, often they don’t, and when they don’t the browser spends a couple minutes trying to load the page before timing out and giving an Internal Server Error. That long timeout makes it hard to troubleshoot.
As an example, I have a simple file, <ad.fcgi>. I just loaded it in a browser successfully. I hit Reload, it loaded again just fine. I hit Reload again, and this third time, I get the interminable trying-to-load-the-page-with-the-eventual-timeout. The error in the logfile says:
[Thu Nov 16 12:29:06 2006] [error] [client 66.90.205.24] FastCGI: comm with (dynamic) server “/home/user/domain.com/test/ad.fcgi” aborted: (first read) idle timeout (120 sec)
[Thu Nov 16 12:29:06 2006] [error] [client 66.90.205.24] FastCGI: incomplete headers (0 bytes) received from server “/home/user/domain.com/test/ad.fcgi”
The scripts always run fine from the command line. And of course, the permissions of the file and the enclosing folder are set to 755, and I’m printing the Content-type header. If those things weren’t true, it would never run.
I’ve written to Support several times but they won’t help, and referred me to the forums.