-   Linux - Server (
-   -   FastCGI and Apache not loading pages (

vockleya 07-09-2011 12:43 AM

FastCGI and Apache not loading pages
I am trying to set up my Apache server with FastCGI as the CGI engine. It will be mostly running PHP, but I may add Perl or something else later. I started from a completely fresh install of Ubuntu 11.04 with every update available. I used the install CD to install a LAMP server as part of the system install.

I am using the tutorial at to add the FastCGI functionality. I am having some problems with getting everything to work.

The first problem was that apache2-suexec-custom wouldn't accept a different document root. I fixed that by compiling apache2-suexec from source with the document root changed to the correct path.

The next problem is that every php page I load throws a 500 error. Apache's error logs show that FastCGI isn't returning the page data correctly to Apache.

[Sat Jul 09 01:23:54 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Sat Jul 09 01:23:54 2011] [notice] Apache/2.2.17 (Ubuntu) mod_fcgid/2.3.6 configured -- resuming normal operations
[Sat Jul 09 01:23:55 2011] [warn] [client] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Sat Jul 09 01:23:55 2011] [error] [client] Premature end of script headers: test.php
All that should happen when I open test.php in a browser is that "test" should print on the page. The problem is, a 500 error is thrown, and the page is not displayed. As far as I can tell the php file isn't even being accessed at all.

Any idea what could be causing this? Any help would be greatly appreciated.

vockleya 07-09-2011 02:19 PM

I just got it working. It turns out that I had the fcgi php wrapper script pointing to the wrong php5 executable.

All times are GMT -5. The time now is 09:33 PM.