Take the 2-minute tour ×
Server Fault is a question and answer site for 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
    
It would help if you could post your httpd configuration. –  Jenny D Dec 23 '13 at 6:52

2 Answers 2

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 ...? –  Geraint Jones 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/… –  Geraint Jones 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

This problem was caused for me because mod_php isn't multithreaded, so I suddenly had lots of PHP problems when I turned on the multithreaded mod_spdy.

I fixed it by following Google's recommended fix: disable mod_php and use mod_fcgid instead.

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.