Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
My php homepage downloads index.php instead of being processed on

hi im a newbie with servers so thats why i come here with my prob hoping you can help me. so ubuntu 11.10 and i installed lamp-server but the problem is that i was screwing with file-permissions and stuff and now everything i have to http://localhost/index.php my browser attempts to download the index.php instead of viewing it in the browser.

Is there some sort of way to reset /var/www/ to default settings? if no what is the best way to reinstall lamp-server with default settings?

any help would be much appreciated!

share|improve this question

marked as duplicate by mailq, Zoredache, Ward, voretaq7, MadHatter Oct 28 '11 at 20:05

This question was marked as an exact duplicate of an existing question.

what do you mean by this? – Toby Oct 28 '11 at 19:15
That means someone else asked a similar question. Have you read the link and seen the solutions there fix your problem? If they don't please tell us that you tried the solution, and what happened. – Zoredache Oct 28 '11 at 19:18
Ok i tried something different... if i just take files from windows to my ftp they do not get downloaded but displayed. But if i drag and drop from a tar.gz they get downloaded if i head over to them.. (ffmpeg-php.tar.gz) – Toby Oct 28 '11 at 19:25
up vote 0 down vote accepted

There are several things that could cause this... I am going to assume that because you mentioned permissions, that permissions are the problem:

Run the following commands as root:

chmod -R 755 /var/www
chown -R www-data:www-data /var/www

Also, be sure to clear your browser's cache... The process is different for every browser, so if you don't know how, just leave a comment with your web browser or choice...

EDIT: Added the second command, it may not be the most secure thing in the world, but it will let us work backwards from a known-working state...

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.