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"
Good little catch!
Donny, I don't feel like closing your bugs, so could you... :)
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.
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?
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)
emerge apache emerge mod_php php edit /etc/conf.d/apache2 to enable -D PHP4 works here