Recently upgraded my system from Karmic to Lucid. This involved Apache and PHP being updated I believe.
Now my server is unable to handle PHP files, any navigation to them is triggering downloading rather than parsing.
The PHP module is still loaded in Apache mods-enabled and I have
AddType application/x-httpd-php .php
in my httpd.conf.
There are no meaningful messages in Apache access or error logs so I am stumped.
Any help would be appreciated. Thanks.
Best Answer
/var/log/apache2/error.log
should show a line like the below if PHP was succesfully loaded:Pay attention to the date, if it's something from 2009, you've misconfigured something.
AddType
is useless, you need to use:See also the installation instructions on php.net for Apache 2.x.
You should not have a need to add that manually, the package
libapache2-mod-php5
installs/etc/apache2/mods-available/php5.conf
containing:Since it's a conffile, it's possible that it's not installed with the upgrade. To fix that purge it and then install it again:
To enable PHP, you have to run:
Restart the webserver after:
Other things to do:
/etc/apache2
.sudo apache2ctl configtest
to check your configuration for syntax errorsstatus
module must be loaded for that. If you're running a remote server, you need to add yourself to theAllow from
list in/etc/apache2/mods-enabled/status.conf
and restart the server afterwards