Cant get PHP to work - it is trying to download .php

shaap at shaap at
Wed Mar 5 13:49:53 UTC 2008

On Wed, Mar 05, 2008 at 09:11:41AM -0400, Derek Broughton wrote:
> Philippe Didier wrote:
> > Ben Edwards wrote:
> >> I have installed lamp through synaptic (Edit->Mark Packages by
> >> task...).  When I go to a .php file (e.g. localhost/test.php) the
> >> browser downloads the file.  There is no reference to php in
> >> apache2.config.  What have I missed?
> >>
> > You will find a lot of answers in Google. The first thing and mst easy
> > things to do is to clean Firefox cache. Close all tabs and clean using
> > the menu Tools/Clear private datas... assuming you are using Firefox.
> > Then try again,
> But he still needs _some_ reference to php in his apache configs.  I don't
> use php, so I can't say what the required parts are but I'd expect you need
> the libapache2-mod-php5 package, make sure there's a symlink
> in /etc/apache2/mods-enabled/ to whatever the php module is
> in /etc/apache2/mods-available/, and then you would probably need an
> AddOutputFilterByType instruction in the config files.

Install apache, php and the apache-php-module; configure apache for loading
the apache-php-module and interpreting .php file; start apache:

1. apt-get install apache2 php5 libapache2-mod-php5
2. ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf
3. ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load
4. /etc/init.d/apache2 start


> -- 
> derek
> -- 
> ubuntu-users mailing list
> ubuntu-users at
> Modify settings or unsubscribe at:

More information about the ubuntu-users mailing list