This is kind of long, but wanted to be thorough. I am trying to install LAMP on the Ubuntu Server to setup my own local LAMP box on the network. But once I finish everything, whenever I go to a php page, it prompts for a download. I think have tried everything to make sure every I did all the steps right. Not sure what is going wrong or if I missed something?

- Installing on a VM, Oracle VirtualBox (Created new VM using default settings, Linux Ubuntu 64 Bit). I have the VM using a bridged network connection, with its own static IP set (set in the router)
- Ubuntu Server 11.10 64-bit, barebones install, did not install LAMP or anything else during the Ubuntu Install.

Steps I took:

Once logged in, I installed LAMP, using this:

$: sudo apt-get install tasksel
# tasksel looked to already have been installed
$: sudo tasksel install lamp-server

Once I did that, I setup apache.

I then setup the public_html directory. But I have that elsewhere on the network. So I Installed Samba, mounted the share at /mnt/localwww, then went into my /etc/fstab file and had it auto mount on boot

// /mnt/localwww smbfs username=USERNAME,password=PASSWORD, 0 0

Then I created a symbolic link to the mount to the public_html directory

$: ln -s /mnt/localwww /home/jaesun/public_html

From there, I setup apache2, using this:

$: cd /etc/apache2/mods-enabled
$: sudo ln -s ../mods-available/userdir.conf userdir.conf
$: sudo ln -s ../mods-available/userdir.load userdir.load
$: sudo /etc/init.d/apache2 restart

I modified my host file in my own machine, to point to the Ubuntu server (statically set to, so that http://dev/ will go to my local LAMP server.

I then went to /etc/apache2/sites-available and created a VirtualHost entry

$: cd /etc/apache2/sites-available
$: vi dev

and input this:

<VirtualHost *:80>
    ServerName dev
    DocumentRoot /home/jaesun/public_html

$: cd /etc/apache2/sites-enabled
$: sudo ln -s ../sites-available/dev dev
$: sudo /etc/init.d/apache2 restart

Lastly, I then went to /etc/apache2/ directory, and modified httpd.conf (I have done this to apache2.conf also) to add this:

<FilesMatch \.php$>
    SetHandler application/x-httpd-php

$: sudo /etc/init.d/apache2 restart

Tested it out, got the php download prompt.


$: sudo a2enmod php5
# Stated that this library was already enabled, I restarted apache anyways
$: sudo /etc/init.d/apache2 force-reload

Cleared out my browser history/cache.

Still got the download prompt.

So this is where I am now currently. I have installed Ubuntu Server twice in VM, first time, installing LAMP Server during the install, and the second time, doing a barebones install, both times, getting the same results with the download prompt.

I can view html files fine, view directories in the home directory. But once I view a php file, it prompts to save the download.

I am pretty sure php is installed. I can go to the command line, and do

$: php /home/jaesun/public_html/test/test.php

and it'll output the php/html in test.php (<? echo 'test'; ?> hi)

Did I miss a step somewhere? Am I doing something wrong? Almost wanted to throw the monitor out the window! Any help would be appreciated