[CLUG-tech] Help needed with PHP problem

Izak Burger isburger at gmail.com
Tue Mar 6 13:52:49 SAST 2007


On 3/6/07, Julian Bailey <clubnyala at yahoo.co.uk> wrote:
> Thanks for all your help guys.  I think it's a problem
> with the Apache config too.  Regrettably I don't know
> an awful lot about how Apache is configured - I'm just
> getting into it now.  Can you perhaps point me to the
> area of the apache configuration file that I would
> need to look at?  As I said I'm using Debian Etch.  Is
> the relevant file httpd.conf or some other file?

Debian's apache2 has very nice split config (IMHO anyway).  All
installed modules have  a config file in /etc/apache2/mods-available.
Those that you want active are symlinked into
/etc/apache2/mods-enabled.  The same goes for virtual hosts: All
virtualhosts are configured in a separate file in
/etc/apache2/sites-available and symlinked into
/etc/apache2/sites-enabled.  By default there is only one vhost
configured, called default.

Your problem is almost definitely caused by having two Virtual Hosts,
one that is properly matched by a php enabled virtual host, and the
other one isn't.  This makes me wonder if you have a default apache2
installation (perhaps you are using apache 1.3?).  On a default
apache2 setup it should really just work out of the box, as the
symlink-type configuration system doesn't exactly make it possible to
accidently have php5 enabled for only one virtual host (unless you
specifically turn it off with PHPEngine off), not to mention that a
default config will only HAVE one virtualhost to begin with.

Perhaps look for these lines (or similar):

  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps

If they are enclosed inside a VirtualHost tag, move them outside the
tag and see if it makes a difference.

Alternatively, you may want to try apache2 instead (if you are not
already using it) or at least start with a clean install.  The easier
configuration alone is worth it (once again IMHO) and I don't know of
any serious php issues (there used to be a few issues with apache2 and
php in earlier versions).

regards,
Izak


More information about the clug-tech mailing list