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?

enter image description here

  • It would help if you could post your httpd configuration. – Jenny D Dec 23 '13 at 6:52


AddHandler php5-script .php
AddType text/html .php
  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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