Forum Moderators: phranque

Message Too Old, No Replies

PHP4 with mod fastcgi, help!

I'm almost there!

         

cmer

4:30 am on Oct 1, 2006 (gmt 0)

10+ Year Member



Hi all,

I've been struggling with this problem for days now, and I have no idea what's wrong.

Basically, php files don't run. Instead, the browser tries to "download" them (download box opens).

I cannot use mod_php because it causes problems to mod_python.

Here's the setup:

- Ubuntu Server
- Apache2
- FastCGI
- PHP4 (apt-get install php4-cgi)

AFAIK, the FastCGI server is started because the logs say:
[Sun Oct 01 03:56:49 2006] [notice] FastCGI: process manager initialized (pid 7902)
[Sun Oct 01 03:56:49 2006] [notice] mod_python: Creating 20 session mutexes based on 20 max processes and 0 max threads.
[Sun Oct 01 03:56:49 2006] [warn] FastCGI: server "/usr/bin/php4-cgi" started (pid 7903)

Here are the relevant Apache settings:
-- fastcgi.conf --
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcg .fcgi .fpl
AddHandler php-fastcgi .php
Action php-fastcgi /usr/bin/php4-cgi
AddType application/x-httpd-php .php
FastCgiIpcDir /var/lib/apache2/fastcgi
</IfModule>



-- host/vhost file --
NameVirtualHost *:80

FastCgiServer /usr/bin/php4-cgi

<VirtualHost *:80>
DocumentRoot "/var/www/mysite.com/stats/"
ServerName stats.mysite.com
Options -Indexes ExecCGI
</VirtualHost>

What am I doing wrong?

Thanks for the help!

Carl

jdMorgan

10:04 pm on Oct 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try replacing:

AddType application/x-httpd-php .php

with

AddType text/html .php

to prevent the browser from trying to download instead of rendering the output of php.

Jim