Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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
add comment

1 Answer

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
add comment

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