Gentoo Archives: gentoo-user

From: Michael Sullivan <msulli1355@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: [gentoo-user] PHP won't execute
Date: Fri, 14 Jan 2011 04:01:46
Message-Id: 1294977612.32336.15.camel@camille.espersunited.com
1 A several years ago I ran a public network out of my apartment. I had
2 email, www, etc. etc. It all worked fine. Then one day a couple of
3 years ago we decided that we could not afford to pay for a public IP
4 address anymore, so we had it turned off. I haven't touched apache
5 since then, but we still run that box as it's faster than all the others
6 and runs distcc well. We had a picture page that I wrote back in 2005
7 and occassionally when we have company over we use it to show them
8 pictures that we've taken. I went to the site in my web browser this
9 evening, and saw only PHP code printed on the background image. I've
10 checked the usual suspects:
11
12 carter apache2 # cat /etc/conf.d/apache2
13 # /etc/conf.d/apache2: config file for /etc/init.d/apache2
14
15 # When you install a module it is easy to activate or deactivate the
16 modules
17 # and other features of apache using the APACHE2_OPTS line. Every module
18 should
19 # install a configuration in /etc/apache2/modules.d. In that file will
20 be an
21 # <IfDefine NNN> where NNN is the option to enable that module.
22 # Here are the options available in the default configuration:
23 # USERDIR Enables /~username mapping to /home/username/public_html
24 # INFO Enables mod_info, a useful module for debugging
25 # PROXY Enables mod_proxy
26 # DAV Enables mod_dav
27 # DAV_FS Enables mod_dav_fs (you should enable this when you enable
28 DAV
29 # unless you know what you are doing)
30 # SSL Enables SSL
31 # SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable
32 this
33 # when you enable SSL unless you know what you are
34 doing)
35 # LDAP Enables mod_ldap
36 # AUTH_LDAP Enables authentication through mod_ldap
37 # DEFAULT_VHOST Enables the default virtual host
38 in /var/www/localhost/htdocs
39 APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D MAILMAN -D USERDIR"
40
41 # Extended options for advanced uses of Apache ONLY
42 # You don't need to edit these unless you are doing crazy Apache stuff
43 # As not having them set correctly, or feeding in an incorrect
44 configuration
45 # via them will result in Apache failing to start
46 # YOU HAVE BEEN WARNED.
47
48 # ServerRoot setting
49 #SERVERROOT=/usr/lib/apache2
50
51 # Configuration file location
52 # - If this does NOT start with a '/', then it is treated relative to
53 # $SERVERROOT by Apache
54 #CONFIGFILE=/etc/apache2/httpd.conf
55
56 # Location to log startup errors to
57 # They are normally dumped to your terminal.
58 #STARTUPERRORLOG="/var/log/apache2/startuperror.log"
59
60 # Environment variables to keep
61 # All environment variables are cleared from apache
62 # Use this to preserve some of them
63 # NOTE!!! It's very important that this contains PATH
64 # Also, it will fail if the _value_ of any of these variables contains a
65 space
66 KEEPENV="PATH"
67
68 carter apache2 # cat error_log
69 [Tue Jan 11 03:15:22 2011] [notice] Apache/2.2.16 (Unix) configured --
70 resuming normal operations
71 [Wed Jan 12 03:00:12 2011] [notice] Graceful restart requested, doing
72 restart
73 [Wed Jan 12 03:00:13 2011] [notice] Apache/2.2.16 (Unix) configured --
74 resuming normal operations
75 [Thu Jan 13 19:24:28 2011] [error] [client 192.168.2.3] File does not
76 exist: /home/michael/public_html/camera/$filename, referer:
77 http://carter.espersunited.com/~michael/camera/
78 [Thu Jan 13 19:43:23 2011] [notice] caught SIGTERM, shutting down
79 [Thu Jan 13 19:43:26 2011] [notice] Apache/2.2.16 (Unix) configured --
80 resuming normal operations
81 [Thu Jan 13 19:43:44 2011] [error] [client 192.168.2.3] File does not
82 exist: /home/michael/public_html/camera/$filename, referer:
83 http://carter.espersunited.com/~michael/camera/
84 [Thu Jan 13 19:48:06 2011] [error] [client 192.168.2.3] File does not
85 exist: /home/michael/public_html/camera/$filename, referer:
86 http://carter.espersunited.com/~michael/camera/index.php
87 [Thu Jan 13 19:49:53 2011] [error] [client 192.168.2.3] File does not
88 exist: /home/michael/public_html/camera/$filename, referer:
89 http://carter.espersunited.com/~michael/camera/index.php
90 [Thu Jan 13 19:49:56 2011] [error] [client 192.168.2.3] File does not
91 exist: /home/michael/public_html/camera/$filename, referer:
92 http://carter.espersunited.com/~michael/camera/index.php
93 [Thu Jan 13 19:49:59 2011] [error] [client 192.168.2.3] File does not
94 exist: /home/michael/public_html/camera/$filename, referer:
95 http://carter.espersunited.com/~michael/camera/index.php
96 [Thu Jan 13 19:50:02 2011] [error] [client 192.168.2.3] File does not
97 exist: /home/michael/public_html/camera/$filename, referer:
98 http://carter.espersunited.com/~michael/camera/index.php
99
100 (that $filename reference would have resolved if PHP were executed AS
101 PHP instead of plain text)
102
103 carter apache2 # ls /home/michael/public_html/camera/
104 010105 031706 050706 070707 080905 100304 110804 121107 current
105 thumbnail.php
106 010506 032008 051610 070905 081710 100507 111108 121210
107 current.php thumbnail.php~
108 011305 032907 060509 071006 090205 101004 112004 121809
109 directory.php.bak
110 011409 042608 061608 071405 091105 101405 112206 122404
111 index.php
112 020705 042810 063005 072005 092208 102304 112504 122405
113 oldindex.html
114 022807 050307 070405 080605 100206 110604 120205 123106 test.php
115
116
117 See? There ARE files there.
118
119 What am I missing here? I looked at
120 http://www.gentoo.org/proj/en/apache/doc/troubleshooting.xml
121
122 and it said that the browser cache might be full, so I closed the
123 browser, deleted the cache directory files, and reopened the browser.

Replies

Subject Author
Re: [gentoo-user] PHP won't execute Mick <michaelkintzios@×××××.com>