# apache2 and php4

## joker0225

I am unable to get my php modules to load when i run my /etc/init.d/apache2 restart.  Does anyone out there know how to get apache2 with php working in Gentoo?

----------

## CdWhistler

I will ask the obvious first. Do you have mod_php installed with the apache2 use flag?  The one thing I overlooked when setting up mod_php was having APACHE2_OPTS="-D PHP4" set in /etc/conf.d/apache2 .

----------

## joker0225

This is strange:

I got php working with Apache but not Apache2

and

I got SSL working with Apache2 but not Apache

Here is what the config files slook like:

Apache2:

# Config file for /etc/init.d/apache2

# An example from /etc/apache2/conf/modules.d/40_mod_ssl.conf:

#

# <IfDefine SSL>

#  <IfModule !mod_ssl.c>

#    LoadModule ssl_module    extramodules/mod_ssl.so

#  </IfModule>

# </IfDefine>

#

# This means that the mod_ssl.so DSO module is only loaded

# into the server when you pass "-D SSL" at startup.  To

# enable WebDAV, add "-D DAV -D DAV_FS".  If you installed

# mod_php then add "-D PHP4".  For more options, please

# read the files in the /etc/apache2/conf/modules.d directory.

APACHE2_OPTS="-D SSL -D PHP4"

And for Apache:

# Config file for /etc/init.d/apache

# Here's an example from /etc/apache/conf/apache.conf using mod_ssl:

#

# <IfDefine SSL>

# LoadModule ssl_module    extramodules/libssl.so

# </IfDefine>

#

# This means that libssl.so is only loaded into the server when you

# pass "-D SSL" to it at startup.

#

# Anything else in apache.conf which is guarded similarly, like:

#

# <IfDefine FOO> ... </IfDefine>

#

# can be easily turned on/off by editing APACHE_OPTS below to

# include or to not include "-D FOO".

#

# If you installed mod_throttle, you can add "-D THROTTLE"; if you

# installed mod_dav, then add "-D DAV".  For mod_gzip use "-D GZIP".

# The mod_contribs package has several options you can use.  See

# your apache.conf file for more details.

APACHE_OPTS="-D SSL -D PHP4"

**********************************************************

I wish there was a way (if possible) I could emerge just apache1 with mod_php mod_ssl without having Gentoo emerge apache2?

I think my problem is have 2 apaches emerging together and getting them mixed up with PHP and SSL modules.

Is there a way I can unmerge apache2.  I have php working now for apache1 and I am fine with that; however, I need to work on mod_ssl with apache1 AND I want to unmerge apache2.....  Do you know if that can be done?  I just want Apache1 installed not Apache2.

Anyway, PHP is working fine with my Apache1 I just need to work on getting rid of Apache2 and making mod_ssl work for apache_1.3.28*

Thanks for your help!!   :Smile: Last edited by joker0225 on Thu Oct 02, 2003 6:02 pm; edited 1 time in total

----------

## joker0225

Apache and PHP work fine now   :Very Happy: 

Now I am trying to get Apache and SSL working   :Confused: Last edited by joker0225 on Thu Oct 02, 2003 6:04 pm; edited 1 time in total

----------

## joker0225

This is starnge:

I got php working with Apache but not Apache2

and

I got SSL working with Apache2 but not Apache

Here is what the config files slook like:

Apache2:

# Config file for /etc/init.d/apache2

# An example from /etc/apache2/conf/modules.d/40_mod_ssl.conf:

#

# <IfDefine SSL>

#  <IfModule !mod_ssl.c>

#    LoadModule ssl_module    extramodules/mod_ssl.so

#  </IfModule>

# </IfDefine>

#

# This means that the mod_ssl.so DSO module is only loaded

# into the server when you pass "-D SSL" at startup.  To

# enable WebDAV, add "-D DAV -D DAV_FS".  If you installed

# mod_php then add "-D PHP4".  For more options, please

# read the files in the /etc/apache2/conf/modules.d directory.

APACHE2_OPTS="-D SSL -D PHP4"

And for Apache:

# Config file for /etc/init.d/apache

# Here's an example from /etc/apache/conf/apache.conf using mod_ssl:

#

# <IfDefine SSL>

# LoadModule ssl_module    extramodules/libssl.so

# </IfDefine>

#

# This means that libssl.so is only loaded into the server when you

# pass "-D SSL" to it at startup.

#

# Anything else in apache.conf which is guarded similarly, like:

#

# <IfDefine FOO> ... </IfDefine>

#

# can be easily turned on/off by editing APACHE_OPTS below to

# include or to not include "-D FOO".

#

# If you installed mod_throttle, you can add "-D THROTTLE"; if you

# installed mod_dav, then add "-D DAV".  For mod_gzip use "-D GZIP".

# The mod_contribs package has several options you can use.  See

# your apache.conf file for more details.

APACHE_OPTS="-D SSL -D PHP4"

**********************************************************

I wish there was a way (if possible) I could emerge just apache1 with mod_php mod_ssl without having Gentoo emerge apache2?

I think my problem is have 2 apaches emerging together and getting them mixed up with PHP and SSL modules.

Is there a way I can unmerge apache2.  I have php working now for apache1 and I am fine with that; however, I need to work on mod_ssl with apache1 AND I want to unmerge apache2.....  Do you know if that can be done?  I just want Apache1 installed not Apache2.

Anyway, PHP is working fine with my Apache1 I just need to work on getting rid of Apache2 and making mod_ssl work for apache_1.3.28*

Thanks for your help!!   :Smile: 

----------

## D. M. P. inc

i made php work w. apache 2 in 

/etc/init.d/apache2 

```
# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.40/apache2.confd,v 1.5 2003/09/27 04:47:18 woodchip Exp $

# Config file for /etc/init.d/apache2

# An example from /etc/apache2/conf/modules.d/40_mod_ssl.conf:

#

# <IfDefine SSL>

#  <IfModule !mod_ssl.c>

#    LoadModule ssl_module    extramodules/mod_ssl.so

#  </IfModule>

# </IfDefine>

#

# This means that the mod_ssl.so DSO module is only loaded

# into the server when you pass "-D SSL" at startup.  To

# enable WebDAV, add "-D DAV -D DAV_FS".  If you installed

# mod_php then add "-D PHP4".  For more options, please

# read the files in the /etc/apache2/conf/modules.d directory.

#APACHE2_OPTS="-D SSL

APACHE2_OPTS="-D PHP4"

```

i dnt know yet aout ssl but that made php work for apache2

----------

## joker0225

I unmerged the following:

apache openssl php mod_ssl mod_php

Then I emerge unemerge the following:

apache openssl php mod_ssl mod_php

and I seem to have php and ssl working in apache1.3.28.  I am going to stick with apache1.3.28 since I am more fimiliar with it.  I am still having problems with php in apache2; however, ssl works fine in apache2.

Thanks for your help Nitro   :Smile: 

----------

