public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] PHP won't execute
@ 2011-01-14  2:01 Michael Sullivan
  2011-01-15  2:24 ` Mark Shields
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-14  2:01 UTC (permalink / raw
  To: gentoo-user

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!




^ permalink raw reply	[flat|nested] 16+ messages in thread

* [gentoo-user] PHP won't execute
@ 2011-01-14  4:00 Michael Sullivan
  2011-01-14  6:26 ` Mick
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-14  4:00 UTC (permalink / raw
  To: gentoo-user

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.  




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-14  4:00 Michael Sullivan
@ 2011-01-14  6:26 ` Mick
  2011-01-14 14:13   ` Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Mick @ 2011-01-14  6:26 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 5959 bytes --]

On Friday 14 January 2011 04:00:12 Michael Sullivan 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.

Have you had a look at this thread?

http://article.gmane.org/gmane.linux.gentoo.user/237217

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-14  6:26 ` Mick
@ 2011-01-14 14:13   ` Michael Sullivan
  2011-01-14 20:29     ` Mick
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-14 14:13 UTC (permalink / raw
  To: gentoo-user

On Fri, 2011-01-14 at 06:26 +0000, Mick wrote:
> On Friday 14 January 2011 04:00:12 Michael Sullivan 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.
> 
> Have you had a look at this thread?
> 
> http://article.gmane.org/gmane.linux.gentoo.user/237217
> 

I read through that entire thread, and tried everything it suggested.
No change.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-14 14:13   ` Michael Sullivan
@ 2011-01-14 20:29     ` Mick
  0 siblings, 0 replies; 16+ messages in thread
From: Mick @ 2011-01-14 20:29 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: Text/Plain, Size: 651 bytes --]

On Friday 14 January 2011 14:13:38 Michael Sullivan wrote:
> On Fri, 2011-01-14 at 06:26 +0000, Mick wrote:

> > Have you had a look at this thread?
> > 
> > http://article.gmane.org/gmane.linux.gentoo.user/237217
> 
> I read through that entire thread, and tried everything it suggested.
> No change.


  :-(

In that case the problem may not be php related?

I seem to remember that a couple of years ago apache2 changed its vhost 
configuration files.  I can't recall anymore what these changes were and of 
course I don't know if your problem is in anyway related to it.

Sorry I can't be of more help ...
-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-14  2:01 [gentoo-user] PHP won't execute Michael Sullivan
@ 2011-01-15  2:24 ` Mark Shields
  2011-01-15  2:57   ` Michael Sullivan
  2011-01-15  3:21   ` [gentoo-user] PHP won't execute Michael Sullivan
  0 siblings, 2 replies; 16+ messages in thread
From: Mark Shields @ 2011-01-15  2:24 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 6101 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 8013 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  2:24 ` Mark Shields
@ 2011-01-15  2:57   ` Michael Sullivan
  2011-01-15  3:10     ` Mark Shields
  2011-01-15  3:21   ` [gentoo-user] PHP won't execute Michael Sullivan
  1 sibling, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-15  2:57 UTC (permalink / raw
  To: gentoo-user

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>


Is there a way for me to test if the file is even being loaded?




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  2:57   ` Michael Sullivan
@ 2011-01-15  3:10     ` Mark Shields
  2011-01-15  3:29       ` Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Shields @ 2011-01-15  3:10 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 8828 bytes --]

On Fri, Jan 14, 2011 at 9:57 PM, Michael Sullivan <msulli1355@gmail.com>wrote:

> 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>
>
>
> Is there a way for me to test if the file is even being loaded?
>
>
>
I'm not sure.  Maybe you can find out more info by turning up the level of
logging on Apache:

# sed -i 's/LogLevel warn/LogLevel info/g'
/etc/apache2/modules.d/00_default_settings.conf
# /etc/init.d/apache2 restart

then:

# tail -f /var/log/apache2/error_log

And try a php page

OR

try a php page then

# grep -i php /var/log/apache2/error_log

[-- Attachment #2: Type: text/html, Size: 11388 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  2:24 ` Mark Shields
  2011-01-15  2:57   ` Michael Sullivan
@ 2011-01-15  3:21   ` Michael Sullivan
  1 sibling, 0 replies; 16+ messages in thread
From: Michael Sullivan @ 2011-01-15  3:21 UTC (permalink / raw
  To: gentoo-user

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>







^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  3:10     ` Mark Shields
@ 2011-01-15  3:29       ` Michael Sullivan
  2011-01-15  3:37         ` Mark Shields
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-15  3:29 UTC (permalink / raw
  To: gentoo-user

On Fri, 2011-01-14 at 22:10 -0500, Mark Shields wrote:
> On Fri, Jan 14, 2011 at 9:57 PM, Michael Sullivan
> <msulli1355@gmail.com> wrote:
>         
>         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>
>         
>         
>         Is there a way for me to test if the file is even being
>         loaded?
>         
>         
>  
> I'm not sure.  Maybe you can find out more info by turning up the
> level of logging on Apache:
> 
> 
> # sed -i 's/LogLevel warn/LogLevel
> info/g' /etc/apache2/modules.d/00_default_settings.conf
> # /etc/init.d/apache2 restart
> 
> 
> then:
> 
> 
> # tail -f /var/log/apache2/error_log
> 
> 
> And try a php page
> 
> 
> OR 
> 
> 
> try a php page then
> 
> 
> # grep -i php /var/log/apache2/error_log

I deleted my error_log (after executing the above sed line), restarted
apache, and tried to load my php page, first by IP address, then by
hostname:

carter apache2 # cat error_log
[Fri Jan 14 21:23:54 2011] [info] mod_unique_id: using ip addr
192.168.2.2
[Fri Jan 14 21:23:55 2011] [info] mod_unique_id: using ip addr
192.168.2.2
[Fri Jan 14 21:23:56 2011] [notice] Apache/2.2.16 (Unix) configured --
resuming normal operations
[Fri Jan 14 21:23:56 2011] [info] Server built: Jan 13 2011 19:42:02
[Fri Jan 14 21:24:41 2011] [error] [client 192.168.2.3] File does not
exist: /home/michael/public_html/camera/$filename, referer:
http://192.168.2.2/~michael/camera/index.php
[Fri Jan 14 21:27:34 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


And I apologize if I'm sending multiple copies of the same reply;
evolution is being stupid, and since I don't get my own posts back, when
evolution offers me a chance to restore a message that I thought I had
sent earlier, I assume it didn't actually send it, and I send it
again...






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  3:29       ` Michael Sullivan
@ 2011-01-15  3:37         ` Mark Shields
  2011-01-15  3:53           ` Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Shields @ 2011-01-15  3:37 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 13190 bytes --]

On Fri, Jan 14, 2011 at 10:29 PM, Michael Sullivan <msulli1355@gmail.com>wrote:

> On Fri, 2011-01-14 at 22:10 -0500, Mark Shields wrote:
> > On Fri, Jan 14, 2011 at 9:57 PM, Michael Sullivan
> > <msulli1355@gmail.com> wrote:
> >
> >         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>
> >
> >
> >         Is there a way for me to test if the file is even being
> >         loaded?
> >
> >
> >
> > I'm not sure.  Maybe you can find out more info by turning up the
> > level of logging on Apache:
> >
> >
> > # sed -i 's/LogLevel warn/LogLevel
> > info/g' /etc/apache2/modules.d/00_default_settings.conf
> > # /etc/init.d/apache2 restart
> >
> >
> > then:
> >
> >
> > # tail -f /var/log/apache2/error_log
> >
> >
> > And try a php page
> >
> >
> > OR
> >
> >
> > try a php page then
> >
> >
> > # grep -i php /var/log/apache2/error_log
>
> I deleted my error_log (after executing the above sed line), restarted
> apache, and tried to load my php page, first by IP address, then by
> hostname:
>
> carter apache2 # cat error_log
> [Fri Jan 14 21:23:54 2011] [info] mod_unique_id: using ip addr
> 192.168.2.2
> [Fri Jan 14 21:23:55 2011] [info] mod_unique_id: using ip addr
> 192.168.2.2
> [Fri Jan 14 21:23:56 2011] [notice] Apache/2.2.16 (Unix) configured --
> resuming normal operations
> [Fri Jan 14 21:23:56 2011] [info] Server built: Jan 13 2011 19:42:02
> [Fri Jan 14 21:24:41 2011] [error] [client 192.168.2.3] File does not
> exist: /home/michael/public_html/camera/$filename, referer:
> http://192.168.2.2/~michael/camera/index.php
> [Fri Jan 14 21:27:34 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
>
>
> And I apologize if I'm sending multiple copies of the same reply;
> evolution is being stupid, and since I don't get my own posts back, when
> evolution offers me a chance to restore a message that I thought I had
> sent earlier, I assume it didn't actually send it, and I send it
> again...
>
>
>
>
>
It's no problem.  Gmail realized you had already sent the same message and
collapsed the whole reply as "quoted text" :)

Try running this:

#  echo "phpinfo();" | xargs php -r

What does it output?  anything?

[-- Attachment #2: Type: text/html, Size: 17163 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  3:37         ` Mark Shields
@ 2011-01-15  3:53           ` Michael Sullivan
  2011-01-15 17:31             ` Mark Shields
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-15  3:53 UTC (permalink / raw
  To: gentoo-user

On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote:
<trimmed>
>         
>         
>         
> 
> It's no problem.  Gmail realized you had already sent the same message
> and collapsed the whole reply as "quoted text" :)
> 
> 
> Try running this:
> 
> 
> #  echo "phpinfo();" | xargs php -r
> 
> 
> What does it output?  anything?

It outputs a lot of stuff.  More than my gnome-terminal buffer could
display (as in I issue a reset before I issue the command you sent and I
can't see the command when I scroll all the way up.)  Anything in
particular I should be looking for?  Anything I should grep for?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15  3:53           ` Michael Sullivan
@ 2011-01-15 17:31             ` Mark Shields
  2011-01-15 19:21               ` Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Mark Shields @ 2011-01-15 17:31 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

On Fri, Jan 14, 2011 at 10:53 PM, Michael Sullivan <msulli1355@gmail.com>wrote:

> On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote:
> <trimmed>
> >
> >
> >
> >
> > It's no problem.  Gmail realized you had already sent the same message
> > and collapsed the whole reply as "quoted text" :)
> >
> >
> > Try running this:
> >
> >
> > #  echo "phpinfo();" | xargs php -r
> >
> >
> > What does it output?  anything?
>
> It outputs a lot of stuff.  More than my gnome-terminal buffer could
> display (as in I issue a reset before I issue the command you sent and I
> can't see the command when I scroll all the way up.)  Anything in
> particular I should be looking for?  Anything I should grep for?
>
>
>
>
I just wanted to see if php-cli works.  And it does.

I would recommend re-emerging php at this point, then run etc-update or
dispatch-conf.

[-- Attachment #2: Type: text/html, Size: 1332 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15 17:31             ` Mark Shields
@ 2011-01-15 19:21               ` Michael Sullivan
  2011-01-30 20:55                 ` Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-15 19:21 UTC (permalink / raw
  To: gentoo-user

On Sat, 2011-01-15 at 12:31 -0500, Mark Shields wrote:
> On Fri, Jan 14, 2011 at 10:53 PM, Michael Sullivan
> <msulli1355@gmail.com> wrote:
>         On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote:
>         <trimmed>
>         >
>         >
>         >
>         >
>         > It's no problem.  Gmail realized you had already sent the
>         same message
>         > and collapsed the whole reply as "quoted text" :)
>         >
>         >
>         > Try running this:
>         >
>         >
>         > #  echo "phpinfo();" | xargs php -r
>         >
>         >
>         > What does it output?  anything?
>         
>         
>         It outputs a lot of stuff.  More than my gnome-terminal buffer
>         could
>         display (as in I issue a reset before I issue the command you
>         sent and I
>         can't see the command when I scroll all the way up.)  Anything
>         in
>         particular I should be looking for?  Anything I should grep
>         for?
>         
>         
>         
> 
> I just wanted to see if php-cli works.  And it does.
> 
> 
> I would recommend re-emerging php at this point, then run etc-update
> or dispatch-conf.
> 

I did all three and restarted apache and went to the page.  Still only
see code...





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute
  2011-01-15 19:21               ` Michael Sullivan
@ 2011-01-30 20:55                 ` Michael Sullivan
  2011-01-30 21:07                   ` [gentoo-user] PHP won't execute [SOLVED] Michael Sullivan
  0 siblings, 1 reply; 16+ messages in thread
From: Michael Sullivan @ 2011-01-30 20:55 UTC (permalink / raw
  To: gentoo-user

On Sat, 2011-01-15 at 13:21 -0600, Michael Sullivan wrote:
> On Sat, 2011-01-15 at 12:31 -0500, Mark Shields wrote:
> > On Fri, Jan 14, 2011 at 10:53 PM, Michael Sullivan
> > <msulli1355@gmail.com> wrote:
> >         On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote:
> >         <trimmed>
> >         >
> >         >
> >         >
> >         >
> >         > It's no problem.  Gmail realized you had already sent the
> >         same message
> >         > and collapsed the whole reply as "quoted text" :)
> >         >
> >         >
> >         > Try running this:
> >         >
> >         >
> >         > #  echo "phpinfo();" | xargs php -r
> >         >
> >         >
> >         > What does it output?  anything?
> >         
> >         
> >         It outputs a lot of stuff.  More than my gnome-terminal buffer
> >         could
> >         display (as in I issue a reset before I issue the command you
> >         sent and I
> >         can't see the command when I scroll all the way up.)  Anything
> >         in
> >         particular I should be looking for?  Anything I should grep
> >         for?
> >         
> >         
> >         
> > 
> > I just wanted to see if php-cli works.  And it does.
> > 
> > 
> > I would recommend re-emerging php at this point, then run etc-update
> > or dispatch-conf.
> > 
> 
> I did all three and restarted apache and went to the page.  Still only
> see code...

I've done some further research/testing and discovered that it's only my picture page that's not executing:

From http://carter.espersunited.com/~michael/test.php:

Warning: Unknown: failed to open stream: Permission denied in Unknown on
line 0

Fatal error: Unknown: Failed opening required
'/home/michael/public_html/test.php' (include_path='.:/usr/share/php5:/usr/share/php') in Unknown on line 0

PHP executed.   It returned errors, but it executed, now from one
directory down:

From http://carter.espersunited.com/~michael/camera/index.php:

\n"; print " \n"; print " \n"; print " \n"; print "\n"; print "\n";
print "\n"; print "
\n"; print "\n"; print " \n"; print " \n"; print " \n"; print "
\n"; print "
$title
\n"; print "
\n"; print "
\n
\n"; print "
\n"; $dirname = "."; $dh = opendir($dirname); print "
\n"; while ( gettype($file = readdir($dh)) != boolean) { if
(is_dir("$dirname/$file") && strlen($file) == 6) { #We are in a
directory $strMonth = substr($file, 0, 2); $strDay = substr($file, 2,
2); $strYear = substr($file, 4, 2); $file = $strYear.$strMonth.$strDay;
$dirarray[] = $file; } } closedir($dh); $value = $_POST['Set']; if (!
isset($value)) $value="current"; rsort($dirarray, SORT_STRING); if
($value == "Current") $value = "current"; if ($value == "current")
include("current.php"); if ($value=="All") { foreach ($dirarray as
$file) { $strMonth = substr($file, 2, 2); $strDay = substr($file, 4, 2);
$strYear = substr($file, 0, 2); $file = $strMonth.$strDay.$strYear;
makeTable($dirname, $file); } } if ($value !="current" && $value !=
"All") makeTable($dirname, $value); showList(); print "
\n"; print " \n"; print "\n"; function makeTable($dirname, $file)
{ global $text; global $bgcolor; #The name of this directory is in
mmddyy format. We need to spit it into its individual parts and print it
(mm/dd/yy) $strMonth = substr($file, 0, 2); $strDay = substr($file, 2,
2); $strYear = substr($file, 4); print "\n"; print " \n"; print " \n";
print "\n"; print "
\n"; print "
Added $strMonth"."/".$strDay."/".$strYear."
\n"; print "
\n"; $subdirname = $file; $eh = opendir($subdirname); #We need to make a
table for the thumbnails to appear in... print " \n"; print "\n"; $count
= 1; while (gettype($subfile = readdir($eh)) != boolean) { $ext =
substr($subfile, strlen($subfile) - 3, 3); $ext = strtolower($ext); if
(!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg") { print
"\n"; $count++; if ($count > 5) { print "\n"; print "\n"; $count =
1; } } } print " "; print "
\n"; print "
\n"; } function makeList($file) { print " $file\n"; } function
showList() { global $dirarray; global $dirname; print "\n"; print " \n";
print "\n"; } ?>
\n"; //print "$subfile
\n"; $subfilename = htmlspecialchars($subfile, ENT_QUOTES); $filename =
$dirname."/".$subdirname."/mini/mini-".$subfilename; print "\n"; print
"\"$subfile\"\n"; print "\n"; print "

It occurs to me that I might have an error in the script itself.  I have
posted the entire script here:

michael@carter ~/public_html/camera $ cat index.php 
<?
$title = "My Pictures"; 
$bgcolor = "#339966";   
$text = "#FFFF00";      

print "<html>\n";
print "   <head>\n";
print "      <title>$title</title>\n";
print "   </head>\n";
print "\n";
print "<body background='../images/pawborder.gif' bgcolor='$bgcolor'
text='$text'>\n";
print "\n";
print "<center>\n";
print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor'>\n";
print "   <tr>\n";
print "      <td align='center'>\n";
print "         <h1>$title</h1>\n";
print "      </td>\n";
print "   </tr>\n";
print "</table>\n";
print "<br>\n<br>\n";
print "</center>\n";


$dirname = ".";
$dh = opendir($dirname);
print "<center>\n";
while ( gettype($file = readdir($dh)) != boolean)
{
   if (is_dir("$dirname/$file") && strlen($file) == 6)
   {  #We are in a directory
      $strMonth = substr($file, 0, 2);
      $strDay = substr($file, 2, 2);
      $strYear = substr($file, 4, 2);
      $file = $strYear.$strMonth.$strDay;

      $dirarray[] = $file;
   }
}
closedir($dh);

$value = $_POST['Set'];
if (!isset($value)) $value="current";
rsort($dirarray, SORT_STRING);
if ($value == "Current") $value = "current";
if ($value == "current") include("current.php");

if ($value=="All")
{
   foreach ($dirarray as $file)
   {
      $strMonth = substr($file, 2, 2);
      $strDay = substr($file, 4, 2);
      $strYear = substr($file, 0, 2);
      $file = $strMonth.$strDay.$strYear;
   
      makeTable($dirname, $file);
   }
}
if ($value !="current" && $value != "All")  makeTable($dirname, $value);

showList();
print "      </center>\n";
print "   </body>\n";
print "</html>\n";


function makeTable($dirname, $file)
{
      global $text;
      global $bgcolor;
      #The name of this directory is in mmddyy format.  We need to spit
it into its individual parts and print it (mm/dd/yy)
      $strMonth = substr($file, 0, 2);
      $strDay = substr($file, 2, 2);
      $strYear = substr($file, 4);
      print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor'
border='3'>\n";
      
      print "   <tr>\n";
      print "      <td align='center'>\n";
      
      print "         <h3>Added
$strMonth"."/".$strDay."/".$strYear."</h3>\n";
      print "</td>\n";
      print "</tr>\n";
      print "</table>\n";
      $subdirname = $file;
      $eh = opendir($subdirname);
 
      #We need to make a table for the thumbnails to appear in...
      print "       <table cellspacing='0' cellpadding='0'>\n";      
 
      print "<tr>\n";
      $count = 1;
      while (gettype($subfile = readdir($eh)) != boolean)
      {
	 $ext = substr($subfile, strlen($subfile) - 3, 3);
	 $ext = strtolower($ext);
	 if (!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg")
	 {
	    print "<td>\n";
	    //print "$subfile<br>\n";
	    $subfilename = htmlspecialchars($subfile, ENT_QUOTES);
	    $filename = $dirname."/".$subdirname."/mini/mini-".$subfilename;
	    print "<a href='".$dirname."/".$subdirname."/".$subfilename."'>\n";
	    print "<img src='$filename' width=100 height=100 alt=\"$subfile
\">\n";
	    print "</a>\n";
	    print "</td>\n";
	    $count++;
	    if ($count > 5)
	    {
	       print "</tr>\n";
	       print "<tr>\n";
	       $count = 1;
	    }
	 }
      }
      print "          </tr>";
      print "       </table\n";
      print "       <br>\n";
      print "       <br>\n";
}

function makeList($file)
{
   print "      <option>$file</option>\n";
}

function showList()
{
global $dirarray;
global $dirname;
print "<form action='index.php' method='post'>\n";
print "   <select name='Set'>\n";
print "      <option>All</option>\n";
print "      <option selected>Current</option>\n";
foreach ($dirarray as $file)
{
      $strMonth = substr($file, 2, 2);
      $strDay = substr($file, 4, 2);
      $strYear = substr($file, 0, 2);
      $file = $strMonth.$strDay.$strYear;

   makeList($file);
}
print "   <br><br><input type='submit' value='Select'>\n";
print "</form>\n";

}
?> 

Do you see anything here that would cause PHP to output its code instead
of executing it?




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [gentoo-user] PHP won't execute [SOLVED]
  2011-01-30 20:55                 ` Michael Sullivan
@ 2011-01-30 21:07                   ` Michael Sullivan
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Sullivan @ 2011-01-30 21:07 UTC (permalink / raw
  To: gentoo-user

On Sun, 2011-01-30 at 14:55 -0600, Michael Sullivan wrote:
> On Sat, 2011-01-15 at 13:21 -0600, Michael Sullivan wrote:
> > On Sat, 2011-01-15 at 12:31 -0500, Mark Shields wrote:
> > > On Fri, Jan 14, 2011 at 10:53 PM, Michael Sullivan
> > > <msulli1355@gmail.com> wrote:
> > >         On Fri, 2011-01-14 at 22:37 -0500, Mark Shields wrote:
> > >         <trimmed>
> > >         >
> > >         >
> > >         >
> > >         >
> > >         > It's no problem.  Gmail realized you had already sent the
> > >         same message
> > >         > and collapsed the whole reply as "quoted text" :)
> > >         >
> > >         >
> > >         > Try running this:
> > >         >
> > >         >
> > >         > #  echo "phpinfo();" | xargs php -r
> > >         >
> > >         >
> > >         > What does it output?  anything?
> > >         
> > >         
> > >         It outputs a lot of stuff.  More than my gnome-terminal buffer
> > >         could
> > >         display (as in I issue a reset before I issue the command you
> > >         sent and I
> > >         can't see the command when I scroll all the way up.)  Anything
> > >         in
> > >         particular I should be looking for?  Anything I should grep
> > >         for?
> > >         
> > >         
> > >         
> > > 
> > > I just wanted to see if php-cli works.  And it does.
> > > 
> > > 
> > > I would recommend re-emerging php at this point, then run etc-update
> > > or dispatch-conf.
> > > 
> > 
> > I did all three and restarted apache and went to the page.  Still only
> > see code...
> 
> I've done some further research/testing and discovered that it's only my picture page that's not executing:
> 
> From http://carter.espersunited.com/~michael/test.php:
> 
> Warning: Unknown: failed to open stream: Permission denied in Unknown on
> line 0
> 
> Fatal error: Unknown: Failed opening required
> '/home/michael/public_html/test.php' (include_path='.:/usr/share/php5:/usr/share/php') in Unknown on line 0
> 
> PHP executed.   It returned errors, but it executed, now from one
> directory down:
> 
> From http://carter.espersunited.com/~michael/camera/index.php:
> 
> \n"; print " \n"; print " \n"; print " \n"; print "\n"; print "\n";
> print "\n"; print "
> \n"; print "\n"; print " \n"; print " \n"; print " \n"; print "
> \n"; print "
> $title
> \n"; print "
> \n"; print "
> \n
> \n"; print "
> \n"; $dirname = "."; $dh = opendir($dirname); print "
> \n"; while ( gettype($file = readdir($dh)) != boolean) { if
> (is_dir("$dirname/$file") && strlen($file) == 6) { #We are in a
> directory $strMonth = substr($file, 0, 2); $strDay = substr($file, 2,
> 2); $strYear = substr($file, 4, 2); $file = $strYear.$strMonth.$strDay;
> $dirarray[] = $file; } } closedir($dh); $value = $_POST['Set']; if (!
> isset($value)) $value="current"; rsort($dirarray, SORT_STRING); if
> ($value == "Current") $value = "current"; if ($value == "current")
> include("current.php"); if ($value=="All") { foreach ($dirarray as
> $file) { $strMonth = substr($file, 2, 2); $strDay = substr($file, 4, 2);
> $strYear = substr($file, 0, 2); $file = $strMonth.$strDay.$strYear;
> makeTable($dirname, $file); } } if ($value !="current" && $value !=
> "All") makeTable($dirname, $value); showList(); print "
> \n"; print " \n"; print "\n"; function makeTable($dirname, $file)
> { global $text; global $bgcolor; #The name of this directory is in
> mmddyy format. We need to spit it into its individual parts and print it
> (mm/dd/yy) $strMonth = substr($file, 0, 2); $strDay = substr($file, 2,
> 2); $strYear = substr($file, 4); print "\n"; print " \n"; print " \n";
> print "\n"; print "
> \n"; print "
> Added $strMonth"."/".$strDay."/".$strYear."
> \n"; print "
> \n"; $subdirname = $file; $eh = opendir($subdirname); #We need to make a
> table for the thumbnails to appear in... print " \n"; print "\n"; $count
> = 1; while (gettype($subfile = readdir($eh)) != boolean) { $ext =
> substr($subfile, strlen($subfile) - 3, 3); $ext = strtolower($ext); if
> (!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg") { print
> "\n"; $count++; if ($count > 5) { print "\n"; print "\n"; $count =
> 1; } } } print " "; print "
> \n"; print "
> \n"; } function makeList($file) { print " $file\n"; } function
> showList() { global $dirarray; global $dirname; print "\n"; print " \n";
> print "\n"; } ?>
> \n"; //print "$subfile
> \n"; $subfilename = htmlspecialchars($subfile, ENT_QUOTES); $filename =
> $dirname."/".$subdirname."/mini/mini-".$subfilename; print "\n"; print
> "\"$subfile\"\n"; print "\n"; print "
> 
> It occurs to me that I might have an error in the script itself.  I have
> posted the entire script here:
> 
> michael@carter ~/public_html/camera $ cat index.php 
> <?
> $title = "My Pictures"; 
> $bgcolor = "#339966";   
> $text = "#FFFF00";      
> 
> print "<html>\n";
> print "   <head>\n";
> print "      <title>$title</title>\n";
> print "   </head>\n";
> print "\n";
> print "<body background='../images/pawborder.gif' bgcolor='$bgcolor'
> text='$text'>\n";
> print "\n";
> print "<center>\n";
> print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor'>\n";
> print "   <tr>\n";
> print "      <td align='center'>\n";
> print "         <h1>$title</h1>\n";
> print "      </td>\n";
> print "   </tr>\n";
> print "</table>\n";
> print "<br>\n<br>\n";
> print "</center>\n";
> 
> 
> $dirname = ".";
> $dh = opendir($dirname);
> print "<center>\n";
> while ( gettype($file = readdir($dh)) != boolean)
> {
>    if (is_dir("$dirname/$file") && strlen($file) == 6)
>    {  #We are in a directory
>       $strMonth = substr($file, 0, 2);
>       $strDay = substr($file, 2, 2);
>       $strYear = substr($file, 4, 2);
>       $file = $strYear.$strMonth.$strDay;
> 
>       $dirarray[] = $file;
>    }
> }
> closedir($dh);
> 
> $value = $_POST['Set'];
> if (!isset($value)) $value="current";
> rsort($dirarray, SORT_STRING);
> if ($value == "Current") $value = "current";
> if ($value == "current") include("current.php");
> 
> if ($value=="All")
> {
>    foreach ($dirarray as $file)
>    {
>       $strMonth = substr($file, 2, 2);
>       $strDay = substr($file, 4, 2);
>       $strYear = substr($file, 0, 2);
>       $file = $strMonth.$strDay.$strYear;
>    
>       makeTable($dirname, $file);
>    }
> }
> if ($value !="current" && $value != "All")  makeTable($dirname, $value);
> 
> showList();
> print "      </center>\n";
> print "   </body>\n";
> print "</html>\n";
> 
> 
> function makeTable($dirname, $file)
> {
>       global $text;
>       global $bgcolor;
>       #The name of this directory is in mmddyy format.  We need to spit
> it into its individual parts and print it (mm/dd/yy)
>       $strMonth = substr($file, 0, 2);
>       $strDay = substr($file, 2, 2);
>       $strYear = substr($file, 4);
>       print "<table cellspacing='0' cellpadding='0' bgcolor='$bgcolor'
> border='3'>\n";
>       
>       print "   <tr>\n";
>       print "      <td align='center'>\n";
>       
>       print "         <h3>Added
> $strMonth"."/".$strDay."/".$strYear."</h3>\n";
>       print "</td>\n";
>       print "</tr>\n";
>       print "</table>\n";
>       $subdirname = $file;
>       $eh = opendir($subdirname);
>  
>       #We need to make a table for the thumbnails to appear in...
>       print "       <table cellspacing='0' cellpadding='0'>\n";      
>  
>       print "<tr>\n";
>       $count = 1;
>       while (gettype($subfile = readdir($eh)) != boolean)
>       {
> 	 $ext = substr($subfile, strlen($subfile) - 3, 3);
> 	 $ext = strtolower($ext);
> 	 if (!is_dir("$dirname/$subdirname/$subfile") && $ext == "jpg")
> 	 {
> 	    print "<td>\n";
> 	    //print "$subfile<br>\n";
> 	    $subfilename = htmlspecialchars($subfile, ENT_QUOTES);
> 	    $filename = $dirname."/".$subdirname."/mini/mini-".$subfilename;
> 	    print "<a href='".$dirname."/".$subdirname."/".$subfilename."'>\n";
> 	    print "<img src='$filename' width=100 height=100 alt=\"$subfile
> \">\n";
> 	    print "</a>\n";
> 	    print "</td>\n";
> 	    $count++;
> 	    if ($count > 5)
> 	    {
> 	       print "</tr>\n";
> 	       print "<tr>\n";
> 	       $count = 1;
> 	    }
> 	 }
>       }
>       print "          </tr>";
>       print "       </table\n";
>       print "       <br>\n";
>       print "       <br>\n";
> }
> 
> function makeList($file)
> {
>    print "      <option>$file</option>\n";
> }
> 
> function showList()
> {
> global $dirarray;
> global $dirname;
> print "<form action='index.php' method='post'>\n";
> print "   <select name='Set'>\n";
> print "      <option>All</option>\n";
> print "      <option selected>Current</option>\n";
> foreach ($dirarray as $file)
> {
>       $strMonth = substr($file, 2, 2);
>       $strDay = substr($file, 4, 2);
>       $strYear = substr($file, 0, 2);
>       $file = $strMonth.$strDay.$strYear;
> 
>    makeList($file);
> }
> print "   <br><br><input type='submit' value='Select'>\n";
> print "</form>\n";
> 
> }
> ?> 
> 
> Do you see anything here that would cause PHP to output its code instead
> of executing it?
> 
I changed the first line of my script from <? to <?php and it seems to
execute now.  The script no longer works; I guess PHP has gotten
stricter since it was when I wrote this script.  Now I have to go
refresh my php knowledge so I can fix the script...




^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-01-30 21:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14  2:01 [gentoo-user] PHP won't execute Michael Sullivan
2011-01-15  2:24 ` Mark Shields
2011-01-15  2:57   ` Michael Sullivan
2011-01-15  3:10     ` Mark Shields
2011-01-15  3:29       ` Michael Sullivan
2011-01-15  3:37         ` Mark Shields
2011-01-15  3:53           ` Michael Sullivan
2011-01-15 17:31             ` Mark Shields
2011-01-15 19:21               ` Michael Sullivan
2011-01-30 20:55                 ` Michael Sullivan
2011-01-30 21:07                   ` [gentoo-user] PHP won't execute [SOLVED] Michael Sullivan
2011-01-15  3:21   ` [gentoo-user] PHP won't execute Michael Sullivan
  -- strict thread matches above, loose matches on Subject: below --
2011-01-14  4:00 Michael Sullivan
2011-01-14  6:26 ` Mick
2011-01-14 14:13   ` Michael Sullivan
2011-01-14 20:29     ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox