Weird Apache/PHP issue

Discussion in 'Apache' started by jimrthy, Aug 14, 2005.

  1. #1
    I'm running linux, with Apache installed locally for development. At some point while I wasn't looking, Apache quit processing PHP. It just displays source code. I have no idea what I did to break it.

    I've just reinstalled apache (2.0.54-r8) and mod_php (4.4.0). I did configure mod_php to work with apache2.

    I've been through the HOWTO's over and over, checking my configuration. Here's the details (I think I'm getting all the configuration files):

    /etc/apache2/conf/apache2.conf:
    LoadModule php4_module extramodules/libphp4.so

    /etc/apache2/conf/commonapache2.conf:
    <IfModule mod_mime.c>
    TypesConfig conf/mime.types

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
    </IfModule>

    (So maybe mod_mime isn't loading? How can I check that?)

    /usr/liblapache2/build/config_vars.mk has
    DSO_MODULES = ... mime ...
    (Lots of others, I'll be happy to paste them all if anyone's interested)

    /etc/apache2/conf/apache2.conf does have
    LoadModule mime_module modules/mod_mime.so

    /etc/apache2/conf/modules.d/70_mod_php.conf -- a default version that got installed automatically at some point. When I put garbage in there, apache won't start.

    When I use /etc/init.d/apache2 restart I get the following in my error log:
    [Mon Aug 08 20:31:44 2005] [notice] Digest: generating secret for digest authentication ...
    [Mon Aug 08 20:31:44 2005] [notice] Digest: done
    [Mon Aug 08 20:31:45 2005] [notice] Apache/2.0.54 (Gentoo/Linux) configured -- resuming normal opera
    tions

    Using apache2ctl -D PHP4 -D PYTHON -k restart, I get this:

    [Fri Aug 12 15:26:24 2005] [notice] Digest: generating secret for digest authentication ...
    [Fri Aug 12 15:26:24 2005] [notice] Digest: done
    [Fri Aug 12 15:26:25 2005] [notice] mod_python: Creating 32 session mutexes based on 150 max process
    es and 0 max threads.
    [Fri Aug 12 15:26:25 2005] [notice] Apache/2.0.54 (Gentoo/Linux) PHP/4.4.0 mod_python/3.1.3 Python/2.3.4 configured -- resuming normal operations

    Everything else in the error logs looks peachy.

    /etc/apache2/apache2-builtin-mods has the line (still wondering if it could be some sort of mime problem):
    mod_mime shared

    /etc/conf.d/apache2 does have the line
    APACHE2_OPTS="-D PHP4 -D PYTHON"

    Python and perl cgi work fine, BTW.

    Does anyone have any thoughts? Am I missing something obvious?

    Thanks in advance,
    James
     
    jimrthy, Aug 14, 2005 IP
  2. jimrthy

    jimrthy Guest

    Messages:
    283
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've been beating my head against the wall for days on this. I post to a forum, and the solution falls into my lap. Go figure.

    When I first started looking into the problem, I ran across a post advising people to add the following line to commonapache2.conf:

    AddType text/html .php

    I did, it didn't fix the problem, and I pretty much forgot about it. I've been meaning to take it back out, with all the other trouble-shooting I've done, but I never could seem to find it.

    Today, digging through the configuration files some more, I finally ran back across it, REM'd the line out, and PHP started working again.

    I hate wasting time on server configuration :p
     
    jimrthy, Aug 14, 2005 IP
    nevetS likes this.
  3. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #3
    you have to recompile apache I think...also try to recompile php from source
     
    RectangleMan, Aug 21, 2005 IP