Apache won't translate the php to html

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
Patrick

Apache won't translate the php to html

Post by Patrick »

I installed mantis on a debian server, and used the module manager aptitude to install mantis and its dependencies.

When I attempt to connect to localhost/mantis I get prompted to download a file. The file name changes every time I do this but the contents remain the same:

Code: Select all

<?php
	# Mantis - a php based bugtracking system
	# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
	# Copyright (C) 2002 - 2004  Mantis Team   - mantisbt-dev@lists.sourceforge.net
	# This program is distributed under the terms and conditions of the GPL
	# See the README and LICENSE files for details

	# --------------------------------------------------------
	# $Id: index.php,v 1.14 2004/01/11 07:16:07 vboctor Exp $
	# --------------------------------------------------------
?>
<?php require_once( 'core.php' ) ?>
<?php
	if ( auth_is_user_authenticated() ) {
		print_header_redirect( 'main_page.php' );
	} else {
		print_header_redirect( 'login_page.php' );
	}
?>
I can also download all of the php files in the mantis install directory. For example localhost/mantis/main_page.php will direct me to download the main_page.php file.

It seems that apache is not translating the php to html. I didn't see any build errors, so I am not quite sure were to start with this problem. Any help is greatly appreciated.

Patrick Burns

thraxisp
Developer
Posts: 509
Joined: Feb 13, 2005 10:38 pm
Location: Ottawa, Canada
Contact:

Post by thraxisp »

You probably need the following lines in your http.conf file.

LoadModule php4_module /<path to php4>/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php

Then restart apache to activate the changes.

Post Reply