From owner-freebsd-questions@FreeBSD.ORG Thu Jun 21 15:42:44 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 19AC916A400 for ; Thu, 21 Jun 2007 15:42:44 +0000 (UTC) (envelope-from doug@safeport.com) Received: from pemaquid.safeport.com (pemaquid.safeport.com [209.31.154.17]) by mx1.freebsd.org (Postfix) with ESMTP id B7C1B13C457 for ; Thu, 21 Jun 2007 15:42:43 +0000 (UTC) (envelope-from doug@safeport.com) Received: from localhost (localhost [127.0.0.1]) by pemaquid.safeport.com (8.13.4/8.13.4) with ESMTP id l5LFggb5052684; Thu, 21 Jun 2007 11:42:42 -0400 (EDT) (envelope-from doug@safeport.com) Date: Thu, 21 Jun 2007 11:42:42 -0400 (EDT) From: doug@safeport.com To: Jack Barnett In-Reply-To: <4679DA07.4060307@gmail.com> Message-ID: <20070621112805.F31979@pemaquid.safeport.com> References: <467763C3.306@gmail.com> <20070620112448.G5906@fledge.watson.org> <4679DA07.4060307@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (pemaquid.safeport.com [127.0.0.1]); Thu, 21 Jun 2007 11:42:42 -0400 (EDT) Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Apache, php? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 15:42:44 -0000 On Wed, 20 Jun 2007, Jack Barnett wrote: > doug wrote: >> On Tue, 19 Jun 2007, 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 >>> >> I just installed this combination, among the changes to httpd.conf I change >> pph4-->php5 (see below). You are not getting an index file. If you have >> 'Options +Indexes' browsing will get you an index listing but will not run >> index.php. >> >> >> # >> # This may also be "None", "All", or any combination of "Indexes", >> @@ -452,18 +454,18 @@ >> # >> >> >> - >> + >> DirectoryIndex index.php index.php3 index.html >> >> - >> + >> DirectoryIndex index.php3 index.html >> >> >> >> - >> + >> DirectoryIndex index.php index.html >> >> - >> + >> DirectoryIndex index.html >> >> >> > > hrm... no I don't think that's it. > I put this in: > DirectoryIndex index.php index.html > > I have php5 install > > I created this file: > test.php > \n"); ?> > But that doesn't work either. > > Is mod_layout screwing it up? > > I don't understand what is wrong with it? > `php test.php` works fine. > > Also there is no Module Load/Add in the httpd.conf for php. I can't even > find the libraries! > > But /usr/local/bin/ has php and php-cgi (both executables). > > Do I need to tell apache how to execute .php files? > Not sure you may also be missing the additions to the load and add modules sections. This setup was specifically to run SquirrelMail. I had a working test install and I wanted to add SSL. My first shot was to just reinstall apache-modssl. This required recompiling a single php module. I never got that done so I removed apache, php and squirrel mail and installed (order is important): apache-modssl squirrelmail and let the build for squirrelmail pull in php. In this order I got all the necessary mods to httpd.conf and the php module I needed was rebuilt. If you are facile with make all this can be skipped but I found it quicker to do it this way. Here are the php relate directive in my httpd.conf: : LoadModule php5_module libexec/apache/libphp5.so : AddModule mod_php5.c : DirectoryIndex index.php index.php3 index.html DirectoryIndex index.php3 index.html DirectoryIndex index.php index.html DirectoryIndex index.html : AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps : #SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire SSLOptions +StdEnvVars This last one only if you have SSL (of course). _____ Douglas Denault http://www.safeport.com doug@safeport.com Voice: 301-469-8766 Fax: 301-469-0601