Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

For some reason, no matter what page I try to open (.php, .html, .html, etc) my server trys to save it, rather than displaying the page. However, I do get the "It Works!" page for the main domain, it's only when I try to display a page on a sub-directory that it fails.

I researched the problem, and I placed a .htaccess file in the directory of the pages that I'm attempting open with the code:

AddType application/x-httpd-php5 .php .html .htm
AddHandler applicaton/x-httpd-php5 .php .htm .html .my

I'm running the latest version of apache and php5 which is installed as the "php5" module.

Any help?

http://i.stack.imgur.com/fh6dj.png

share|improve this question

2 Answers

Try

AddHandler php5-script .php
AddType text/html .php
share|improve this answer
That didn't seem to help. Just to be sure, the .htaccess file goes in the same subfolder as index.html? I was never really sure whether I got the .htaccess system setup properly. – GuyNoir Oct 11 '10 at 0:58
Yeah it goes in the root of your site, but try what i suggested in the apache config, oh and is this CentOS or Debian or ...? – c10k Consulting Oct 11 '10 at 1:01
It's Ubuntu, and I'll try it in the config. – GuyNoir Oct 11 '10 at 1:18
try this : help.ubuntu.com/community/… – c10k Consulting Oct 11 '10 at 1:20
Still not working. I think it's a problem with my apache configurationas I'm getting "VirtualHost :80 -- mixing * ports and non- ports with a NameVirtualHost address is not supported, proceeding with undefined results" errors on restart. – GuyNoir Oct 17 '10 at 2:17

Just for kicks, run this:

sudo apt-get install libapache2-mod-php5

And be sure to clear your cache between tests.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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