From owner-freebsd-questions@FreeBSD.ORG Tue Jun 19 07:20:03 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A35DA16A481 for ; Tue, 19 Jun 2007 07:20:03 +0000 (UTC) (envelope-from ivan@careytech.com.au) Received: from ipmail01.adl2.internode.on.net (ipmail01.adl2.internode.on.net [203.16.214.140]) by mx1.freebsd.org (Postfix) with ESMTP id A295A13C4B7 for ; Tue, 19 Jun 2007 07:19:56 +0000 (UTC) (envelope-from ivan@careytech.com.au) X-IronPort-AV: E=Sophos;i="4.16,437,1175437800"; d="scan'208";a="145336907" Received: from ppp154-213.static.internode.on.net (HELO [192.168.1.2]) ([150.101.154.213]) by ipmail01.adl2.internode.on.net with ESMTP; 19 Jun 2007 16:49:49 +0930 Message-ID: <46778398.7080506@careytech.com.au> Date: Tue, 19 Jun 2007 17:19:52 +1000 From: Ivan Carey User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: jackbarnett@gmail.com References: <467763C3.306@gmail.com> In-Reply-To: <467763C3.306@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Apache, php? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ivan@careytech.com.au List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 07:20:03 -0000 Jack Barnett wrote: > FreeBSD 6.2 > Apache 1.3.37 (from ports) > php 5.2.3 (from ports) > > on the command line doing `php index.php` works. > But if I use it though a web browser it just displays the php code. > > I installed it like this (extensions to) > http://www.mydigitallife.info/2006/04/14/installing-web-server-in-freebsd-60-with-apache-22-mysql-50-and-php-5-part-5/ > > > The only difference is that I'm using 1.3 and not 2.x of Apache. > > Apache config below > Installing 2.x isn't an option yet (test server, still need 1.3) > > fire2# grep -i php * > httpd.conf:AddType application/x-httpd-php .php > httpd.conf:AddType application/x-httpd-php-source .phps > httpd.conf: > httpd.conf: > httpd.conf: DirectoryIndex index.php index.php3 index.html > httpd.conf: > httpd.conf: DirectoryIndex index.php3 index.html > httpd.conf: > httpd.conf: > httpd.conf: DirectoryIndex index.php index.html > httpd.conf: > httpd.conf: > httpd.conf: AddType application/x-httpd-php3 .php3 > httpd.conf: AddType application/x-httpd-php3-source .php3s > httpd.conf: > httpd.conf: AddType application/x-httpd-php .php > httpd.conf: AddType application/x-httpd-php-source .phps > httpd.conf: AddType application/x-httpd-php .php > httpd.conf: AddType application/x-httpd-php-source .phps > > > > > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" > > . > Hello Jack, I have 2 servers running one with php4 and one with php5 In the php4 httpd.conf I have: LoadModule php4_module libexec/apache/libphp4.so AddModule mod_php4.c # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # DirectoryIndex index.php index.php3 index.html DirectoryIndex index.php3 index.html DirectoryIndex index.php index.html DirectoryIndex index.html # LanguagePriority allows you to give precedence to some languages # in case of a tie during content negotiation. # # Just list the languages in decreasing order of preference. We have # more or less alphabetized them here. You probably want to change this. # LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw AddType application/x-httpd-php3 .php3 AddType application/x-httpd-php3-source .php3s AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps In the Apache2 using php5 I have in the httpd.conf LoadModule php5_module libexec/apache2/libphp5.so # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps I hope this helps you with your configuration, Regards, Ivan