Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 30927

Summary: Default apache2 start script is configured incorrectly for options
Product: Gentoo Linux Reporter: Burhan Khalid <burhan.khalid>
Component: Current packagesAssignee: Gentoo Web Application Packages Maintainers <web-apps>
Status: RESOLVED INVALID    
Severity: minor CC: hythloday
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Burhan Khalid 2003-10-11 14:00:15 UTC
After emerging mod_php and setting the APACHE2_OPTS variable with -D PHP4, on 
apache2ctl start, apache will not load the module because the <IfDefine PHP4> 
conditional does not evaluate as true. Further investigation revealed that the 
init.d/apache2 script had an error. I was able to fix the problem by modifiying 
the start() section of the script so that ${APACHE2_OPTS} was *before* the -k 
start option.

Reproducible: Always
Steps to Reproduce:
1. emerge mod_php
2. echo "<?php phpinfo(); ?>" > /home/httpd/htdocs/info.php
3. browse to info.php

For any .php file in htdocs directory this is true.

Actual Results:  
The code was displayed on the screen.

Expected Results:  
Expected to see the PHP output, not the source code.

Portage 2.0.49-r3 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r6)
=================================================================
System uname: 2.4.20-gentoo-r6 i686 Pentium Pro
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=i686 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/confi
g /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm crypt cups gif imlib jpeg mmx motif ncurses nls pdflib png spell 
svga truetype xml2 zlib gdbm berkdb slang readline java tcpd pam libwww ssl 
perl python apache2 curl doc expat flash gd gd-external imagemagick imap innodb 
javascript justify ldap maildir mbox mcal mysql samba socks5 tiff -oss -arts -
avi -encode -foomaticdb -gpm -gtk -kde -gnome -libg++ -mad -mikmod -mpeg -
oggvorbis -opengl -qt -quicktime -sdl -X -xmms -xv"
Comment 1 Donny Davies (RETIRED) gentoo-dev 2003-10-11 23:48:33 UTC
Good little catch!
Comment 2 Markus Nigbur (RETIRED) gentoo-dev 2003-10-18 17:06:27 UTC
Donny, I don't feel like closing your bugs, so could you... :)
Comment 3 Donny Davies (RETIRED) gentoo-dev 2003-10-18 19:10:43 UTC
Markus Nigbur; excuse me, but I will close/fix it when I have time.

Why are you posting irritating comments like that?  Its a small glitch at
BEST and I work on this project in my vounteered, spare time.
Comment 4 Donny Davies (RETIRED) gentoo-dev 2003-10-18 19:25:48 UTC
Well after taking a closer look:

If I start apache2 with the init.d/apache script, the command line looks
like:
    /usr/sbin/apache2 -k start -D PHP4 -D SSL
and my PHP applications work.

If I start apache2 with apache2ctl, the command line looks like:
    /usr/sbin/apache2 -D PHP4 -D SSL -k start
and my PHP applications work.

This is with tge apache-2.0.47-r1 ebuild, so what is there to fix?
Comment 5 Burhan Khalid 2003-10-31 19:27:38 UTC
Got same error with the new Apache emerge ( net-www/apache-2.0.48 ). Apache
wouldn't start when APACHE_OPTS="-D PHP4", same fix as before (edit the /etc/init.d/apache2
script, move ${APACHE_OPTS} so its before -k start)
Comment 6 Martin Holzer (RETIRED) gentoo-dev 2003-11-25 11:35:16 UTC
emerge apache 
emerge mod_php php
edit /etc/conf.d/apache2
to enable -D PHP4


works here