How do I 'activate' mod_php5?

Kjell Midtseter junkmail at sensewave.com
Mon Nov 15 12:58:35 PST 2004


On Monday, 15 November 2004 at 14:33:02 -0600, Kevin D. Kinsey, DaleCo, S.P. wrote:
> Kjell Midtseter wrote:
> 
> >On Monday, 15 November 2004 at 10:20:32 -0600, Kevin D. Kinsey, DaleCo, 
> >S.P. wrote:
> > 
> >
> >>Kjell Midtseter wrote:
> >>
> >>   
> >>
> >>>After installing lang/php4-extensions with apache13, 
> >>>I can start using embedded php in my web pages right away. 
> >>>When installing lang/php5-extensions, the embedded php 
> >>>is passed as if it were html without being interpreted. 
> >>>Any initialization required fro php5?
> >>>The required modules seems to be in place in httpd.conf
> >>>I get the same results when I make a new clean and cvsup'ed install from 
> >>>the 5.3R CD Kjell
> >>>     
> >>>
> >>The procedure is the same for PHP5 as it was for PHP4,
> >>with no variations *that I have noticed*.
> >>
> >>So, the first question ... have you added/modified/created
> >>the necessary AddModule, LoadModule, and AddHandler
> >>(or is it AddType?) lines in your httpd.conf?
> >>
> >>   
> >>
> >What I have done is:
> >1) Loaded a system from the 5.3R CD, cvsup'ed and built world etc, 
> >cvsup'ed ports and upgraded. Then installed lang4-extensions/apache13
> >2) Repeated 1) on a second box, but installing lang5-extensions/apache13
> >3) Repeated 1) on the second box, but installing lang5-extensions/apache2
> >
> >Used the same options in all 3 cases. (slight diffs in the apache2 case)
> >
> >1) works as always. I find 
> >LoadModule php4_module        libexec/apache/libphp4.so
> >AddModule mod_php4.c
> >in httpd.conf (No need to add anything)
> >
> >2) does not work. I find
> >LoadModule php5_module        libexec/apache/libphp5.so
> >AddModule mod_php5.c
> >in httpd.conf 
> >
> >3) does not work. I find
> >LoadModule php5_module        libexec/apache2/libphp5.so
> >in httpd.conf (no AddModule) 
> >
> > 
> >
> <snipped Index options>
> <snipped more of my last>
> 
> Thanks for the detailed reply.
> 
> If the issue is really that you are seeing PHP source instead
> of the server "handling" the PHP code, then most likely it is
> the "AddType" directive that is wrong/missing/etc.
> 
> Here is that section of httpd.conf from a working PHP4
> installation:
> 
>    <IfModule mod_php3.c>
>        AddType application/x-httpd-php3 .php3 .html
>        AddType application/x-httpd-php3-source .php3s
>    </IfModule>
>    <IfModule mod_php4.c>
>        AddType application/x-httpd-php .php .html .asp .php3
>        AddType application/x-httpd-php-source .phps
>    </IfModule>  
>
The above section is in my working php4/apache13 httpd.conf, 
but missing in the php5/apache2 httpd.conf
I do not think editing it into my php5/apache2 will help since the
AddModule mod_php5.c is missing. But I will reload my second box with
php5/apache13 and edit the above section into the httpd.conf file
to confirm that it works.
Kjell 
>    In this case, we use PHP to interpret everything as
> the server is low traffic and we use PHP in docs that
> are saved as *.html as well (I think we added *.asp as
> a jibe at M$ ....)  At the moment I've no shell at the
> PHP5 box, but I must assume it's the same there.
> 
> Kevin Kinsey
> 
> ** CRM114 Whitelisted by: kdk at daleco.biz **
> 
> ** ACCEPT: CRM114 Whitelisted by: kdk at daleco.biz **
> 
> 
> -=-Extra Stuff-=-
> 
>  From kdk at daleco.biz Mon Nov 15 21:33:20 2004
> Received: from localhost (localhost.la3sg.net [IPv6:::1])
> 	by tyven.la3sg.net (8.13.1/8.13.1) with ESMTP id iAFKXJFg005392
> 	for <tyven at localhost>; Mon, 15 Nov 2004 21:33:20 +0100 (CET)
> 	(envelope-from kdk at daleco.biz)
> X-Original-To: s1261069 at mailstore.freewave.no
> Delivered-To: s1261069 at mailstore.freewave.no
> Received: from mailfront.server.freewave.no [62.73.196.125]
> 	by localhost with POP3 (fetchmail-6.2.5)
> 	for tyven at localhost (single-drop); Mon, 15 Nov 2004 21:33:20 +0100 
> 	(CET)
> Received: from storm.server.freewave.no (storm.server.freewave.no 
> [62.73.196.124])
> 	by xavier.server.freewave.no (Postfix) with ESMTP id 35BD41B97A
> 	for <s1261069 at mailstore.freewave.no>; Mon, 15 Nov 2004 21:33:17 
> 	+0100 (CET)
> Received: from localhost (localhost.localdomain [127.0.0.1])
> 	by storm.server.freewave.no (Postfix) with ESMTP id AE49A5BA43
> 	for <s1261069 at mailstore.freewave.no>; Mon, 15 Nov 2004 21:32:49 
> 	+0100 (CET)
> Received: from cyclops.server.freewave.no (cyclops.server.freewave.no 
> [62.73.196.122])
> 	by storm.server.freewave.no (Postfix) with ESMTP id 5B9C15BA42
> 	for <junkmail at sensewave.com>; Mon, 15 Nov 2004 21:32:48 +0100 (CET)
> Received: from localhost (localhost [127.0.0.1])
> 	by cyclops.server.freewave.no (Postfix) with ESMTP id E95DE9F10E
> 	for <junkmail at sensewave.com>; Mon, 15 Nov 2004 21:28:12 +0100 (CET)
> Received: from ns1.tiadon.com (SMTP.tiadon.com [69.27.132.161])
> 	by cyclops.server.freewave.no (Postfix) with ESMTP id D5E3E9F108
> 	for <junkmail at sensewave.com>; Mon, 15 Nov 2004 21:28:08 +0100 (CET)
> Received: from [69.27.131.0] ([69.27.131.0]) by ns1.tiadon.com with 
> Microsoft SMTPSVC(6.0.3790.211);
> 	 Mon, 15 Nov 2004 14:29:21 -0600
> Message-ID: <4199127E.6060302 at daleco.biz>
> Date: Mon, 15 Nov 2004 14:33:02 -0600
> From: "Kevin D. Kinsey, DaleCo, S.P." <kdk at daleco.biz>
> User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) 
> Gecko/20041023
> X-Accept-Language: en-us, en
> MIME-Version: 1.0
> To: junkmail at sensewave.com
> Cc: freebsd-questions at freebsd.org
> Subject: Re: How do I 'activate' mod_php5?
> References: <20041115115631.GA2804 at tyven.la3sg.net> 
> <4198D750.5090506 at daleco.biz> <20041115201113.GA4855 at tyven.la3sg.net>
> In-Reply-To: <20041115201113.GA4855 at tyven.la3sg.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> X-OriginalArrivalTime: 15 Nov 2004 20:29:21.0983 (UTC) 
> FILETIME=[CA49A4F0:01C4CB51]
> X-Virus-Scanned: by Freewave AS
> X-Virus-Scanned: by Freewave AS
> 
> Kjell Midtseter wrote:
> 
> >On Monday, 15 November 2004 at 10:20:32 -0600, Kevin D. Kinsey, DaleCo, 
> >S.P. wrote:
> > 
> >
> >>Kjell Midtseter wrote:
> >>
> >>   
> >>
> >>>After installing lang/php4-extensions with apache13, 
> >>>I can start using embedded php in my web pages right away. 
> >>>When installing lang/php5-extensions, the embedded php 
> >>>is passed as if it were html without being interpreted. 
> >>>Any initialization required fro php5?
> >>>The required modules seems to be in place in httpd.conf
> >>>I get the same results when I make a new clean and cvsup'ed install from 
> >>>the 5.3R CD Kjell
> >>>     
> >>>
> >>The procedure is the same for PHP5 as it was for PHP4,
> >>with no variations *that I have noticed*.
> >>
> >>So, the first question ... have you added/modified/created
> >>the necessary AddModule, LoadModule, and AddHandler
> >>(or is it AddType?) lines in your httpd.conf?
> >>
> >>   
> >>
> >What I have done is:
> >1) Loaded a system from the 5.3R CD, cvsup'ed and built world etc, 
> >cvsup'ed ports and upgraded. Then installed lang4-extensions/apache13
> >2) Repeated 1) on a second box, but installing lang5-extensions/apache13
> >3) Repeated 1) on the second box, but installing lang5-extensions/apache2
> >
> >Used the same options in all 3 cases. (slight diffs in the apache2 case)
> >
> >1) works as always. I find 
> >LoadModule php4_module        libexec/apache/libphp4.so
> >AddModule mod_php4.c
> >in httpd.conf (No need to add anything)
> >
> >2) does not work. I find
> >LoadModule php5_module        libexec/apache/libphp5.so
> >AddModule mod_php5.c
> >in httpd.conf 
> >
> >3) does not work. I find
> >LoadModule php5_module        libexec/apache2/libphp5.so
> >in httpd.conf (no AddModule) 
> >
> > 
> >
> <snipped Index options>
> <snipped more of my last>
> 
> Thanks for the detailed reply.
> 
> If the issue is really that you are seeing PHP source instead
> of the server "handling" the PHP code, then most likely it is
> the "AddType" directive that is wrong/missing/etc.
> 
> Here is that section of httpd.conf from a working PHP4
> installation:
> 
>    <IfModule mod_php3.c>
>        AddType application/x-httpd-php3 .php3 .html
>        AddType application/x-httpd-php3-source .php3s
>    </IfModule>
>    <IfModule mod_php4.c>
>        AddType application/x-httpd-php .php .html .asp .php3
>        AddType application/x-httpd-php-source .phps
>    </IfModule>  
> 
>    In this case, we use PHP to interpret everything as
> the server is low traffic and we use PHP in docs that
> are saved as *.html as well (I think we added *.asp as
> a jibe at M$ ....)  At the moment I've no shell at the
> PHP5 box, but I must assume it's the same there.
> 
> Kevin Kinsey
> 
> 
>  
>  
> -0-0-0- 


More information about the freebsd-questions mailing list