From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-118833-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1Pdwjg-0006YD-SN
	for garchives@archives.gentoo.org; Sat, 15 Jan 2011 03:23:29 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C6F00E0A62;
	Sat, 15 Jan 2011 03:22:01 +0000 (UTC)
Received: from mail-yi0-f53.google.com (mail-yi0-f53.google.com [209.85.218.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 84D24E0A62
	for <gentoo-user@lists.gentoo.org>; Sat, 15 Jan 2011 03:22:01 +0000 (UTC)
Received: by yib17 with SMTP id 17so1744605yib.12
        for <gentoo-user@lists.gentoo.org>; Fri, 14 Jan 2011 19:22:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:subject:from:to:in-reply-to:references
         :content-type:date:message-id:mime-version:x-mailer
         :content-transfer-encoding;
        bh=t2FrM44ZDRfkktHmA9u/g7MiSfp9Qyr1pNcY66VWiNQ=;
        b=AbXFzH6z7pF2paT57jpOLEYr8FxYsHfGv4cWEASdovxBbkE3z++56NVN9RHv0JnaoA
         8w6m42bfE/d6aRVj+F2CXQiBZDpISd/Yso+V8KSFlC2jPGhnM3d/zh3L9/FzXrV96YJI
         V6PlDeKrw7+uFcTGZJTloO8Soj2iWLywP9NwU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=subject:from:to:in-reply-to:references:content-type:date:message-id
         :mime-version:x-mailer:content-transfer-encoding;
        b=KgevOKLs5G2gIFIcmJz9G1PL9QwYjM20gdW7u5Ue+AonHPEYwmMI42cTzeLh+Siqwv
         fEoUqWAj9IRqdX0KNkH3Lu+F2YaSXa+7R+60XSuCYgCnFNodt/UNKFcDDGEb2SreAUmr
         GNqUnxA68sScptMEf9+R9TOg9k5wu/K547S/k=
Received: by 10.236.103.145 with SMTP id f17mr3228706yhg.47.1295061719691;
        Fri, 14 Jan 2011 19:21:59 -0800 (PST)
Received: from [192.168.2.3] (adsl-70-234-49-203.dsl.tul2ok.sbcglobal.net [70.234.49.203])
        by mx.google.com with ESMTPS id 50sm1235851yhl.29.2011.01.14.19.21.58
        (version=SSLv3 cipher=RC4-MD5);
        Fri, 14 Jan 2011 19:21:58 -0800 (PST)
Subject: Re: [gentoo-user] PHP won't execute
From: Michael Sullivan <msulli1355@gmail.com>
To: gentoo-user@lists.gentoo.org
In-Reply-To: <AANLkTi=zO_arJqh1Z6tsFFqeKHooWaeGuUQZU0kp3SS=@mail.gmail.com>
References: <1294970501.32336.13.camel@camille.espersunited.com>
	 <AANLkTi=zO_arJqh1Z6tsFFqeKHooWaeGuUQZU0kp3SS=@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
Date: Fri, 14 Jan 2011 21:21:52 -0600
Message-ID: <1295061712.32336.28.camel@camille.espersunited.com>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
Mime-Version: 1.0
X-Mailer: Evolution 2.30.2 
Content-Transfer-Encoding: 7bit
X-Archives-Salt: ebd514cf-ae98-4e64-a1f2-156baf22848e
X-Archives-Hash: f265de01f39ff7cfdf02a0ca3839b4db

On Fri, 2011-01-14 at 21:24 -0500, Mark Shields wrote: 
> On Thu, Jan 13, 2011 at 9:01 PM, Michael Sullivan
> <msulli1355@gmail.com> wrote:
>         A several years ago I ran a public network out of my
>         apartment.  I had
>         email, www, etc. etc.  It all worked fine.  Then one day a
>         couple of
>         years ago we decided that we could not afford to pay for a
>         public IP
>         address anymore, so we had it turned off.  I haven't touched
>         apache
>         since then, but we still run that box as it's faster than all
>         the others
>         and runs distcc well.  We had a picture page that I wrote back
>         in 2005
>         and occassionally when we have company over we use it to show
>         them
>         pictures that we've taken.  I went to the site in my web
>         browser this
>         evening, and saw only PHP code printed on the background
>         image.  I've
>         checked the usual suspects:
>         
>         carter apache2 # cat /etc/conf.d/apache2
>         # /etc/conf.d/apache2: config file for /etc/init.d/apache2
>         
>         # When you install a module it is easy to activate or
>         deactivate the
>         modules
>         # and other features of apache using the APACHE2_OPTS line.
>         Every module
>         should
>         # install a configuration in /etc/apache2/modules.d. In that
>         file will
>         be an
>         # <IfDefine NNN> where NNN is the option to enable that
>         module.
>         # Here are the options available in the default configuration:
>         #   USERDIR   Enables /~username mapping
>         to /home/username/public_html
>         #   INFO      Enables mod_info, a useful module for debugging
>         #   PROXY     Enables mod_proxy
>         #   DAV       Enables mod_dav
>         #   DAV_FS    Enables mod_dav_fs (you should enable this when
>         you enable
>         DAV
>         #             unless you know what you are doing)
>         #   SSL       Enables SSL
>         #   SSL_DEFAULT_VHOST  Enables default vhost for SSL (you
>         should enable
>         this
>         #                      when you enable SSL unless you know
>         what you are
>         doing)
>         #   LDAP      Enables mod_ldap
>         #   AUTH_LDAP Enables authentication through mod_ldap
>         #   DEFAULT_VHOST Enables the default virtual host
>         in /var/www/localhost/htdocs
>         APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D MAILMAN -D USERDIR"
>         
>         # Extended options for advanced uses of Apache ONLY
>         # You don't need to edit these unless you are doing crazy
>         Apache stuff
>         # As not having them set correctly, or feeding in an incorrect
>         configuration
>         # via them will result in Apache failing to start
>         # YOU HAVE BEEN WARNED.
>         
>         # ServerRoot setting
>         #SERVERROOT=/usr/lib/apache2
>         
>         # Configuration file location
>         # - If this does NOT start with a '/', then it is treated
>         relative to
>         # $SERVERROOT by Apache
>         #CONFIGFILE=/etc/apache2/httpd.conf
>         
>         # Location to log startup errors to
>         # They are normally dumped to your terminal.
>         #STARTUPERRORLOG="/var/log/apache2/startuperror.log"
>         
>         # Environment variables to keep
>         # All environment variables are cleared from apache
>         # Use this to preserve some of them
>         # NOTE!!! It's very important that this contains PATH
>         # Also, it will fail if the _value_ of any of these variables
>         contains a
>         space
>         KEEPENV="PATH"
>         
>         carter apache2 # cat error_log
>         [Tue Jan 11 03:15:22 2011] [notice] Apache/2.2.16 (Unix)
>         configured --
>         resuming normal operations
>         [Wed Jan 12 03:00:12 2011] [notice] Graceful restart
>         requested, doing
>         restart
>         [Wed Jan 12 03:00:13 2011] [notice] Apache/2.2.16 (Unix)
>         configured --
>         resuming normal operations
>         [Thu Jan 13 19:24:28 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/
>         [Thu Jan 13 19:43:23 2011] [notice] caught SIGTERM, shutting
>         down
>         [Thu Jan 13 19:43:26 2011] [notice] Apache/2.2.16 (Unix)
>         configured --
>         resuming normal operations
>         [Thu Jan 13 19:43:44 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/
>         [Thu Jan 13 19:48:06 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/index.php
>         [Thu Jan 13 19:49:53 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/index.php
>         [Thu Jan 13 19:49:56 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/index.php
>         [Thu Jan 13 19:49:59 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/index.php
>         [Thu Jan 13 19:50:02 2011] [error] [client 192.168.2.3] File
>         does not
>         exist: /home/michael/public_html/camera/$filename, referer:
>         http://carter.espersunited.com/~michael/camera/index.php
>         
>         (that $filename reference would have resolved if PHP were
>         executed AS
>         PHP instead of plain text)
>         
>         carter apache2 # ls /home/michael/public_html/camera/
>         010105  031706  050706  070707  080905  100304  110804
>          121107  current
>         thumbnail.php
>         010506  032008  051610  070905  081710  100507  111108  121210
>         current.php        thumbnail.php~
>         011305  032907  060509  071006  090205  101004  112004  121809
>         directory.php.bak
>         011409  042608  061608  071405  091105  101405  112206  122404
>         index.php
>         020705  042810  063005  072005  092208  102304  112504  122405
>         oldindex.html
>         022807  050307  070405  080605  100206  110604  120205
>          123106  test.php
>         
>         
>         See?  There ARE files there.
>         
>         What am I missing here?  I looked at
>         http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml
>         
>         and it said that the browser cache might be full, so I closed
>         the
>         browser, deleted the cache directory files, and reopened the
>         browser.
>         No change.  Please help!
>         
>         
> 
> 
> 
> Sounds like your Handlers are missing.  Do you have this file, with
> this in it?
> 
> 
> /etc/apache2/modules.d/70_mod_php5.conf
> <IfModule !mod_php5.c>
> LoadModule php5_module    modules/libphp5.so
> AddHandler application/x-httpd-php .php .php5 .phtml
> AddHandler application/x-httpd-php-source .phps
> DirectoryIndex index.php index.phtml
> 
> 
> 
> 
> - Mark Shields


carter ~ # cat /etc/apache2/modules.d/70_mod_php5.conf 
<IfDefine PHP5>
	# Load the module first
	<IfModule !mod_php5.c>
		LoadModule php5_module    modules/libphp5.so
	</IfModule>

	# Set it to handle the files
	<IfModule mod_mime.c>
		AddHandler application/x-httpd-php .php .php5 .phtml
		AddHandler application/x-httpd-php-source .phps
	</IfModule>

	DirectoryIndex index.php index.phtml
</IfDefine>