Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache not serving up html but is serving php files. Why?

Status
Not open for further replies.

RickLinux

Technical User
Feb 4, 2012
2
US
I set up an Apache server on a Red Hat system and when I access a file in a browser with a "php" extension, then Apache serves it up to the browser. However, when I access a file in a browser with an html extension, then the file system serves it up via a download. Is there a configuration setting that will serve up all browser requests by Apache?

Thanks
 
Hi,

check the directive in your Apache config files httpd.conf

Especially.....

Code:
DirectoryIndex index.htm index.html index.php

I thought that by default Apache presented .htm & .html as webpages but maybe your install is not default .... Note: If you add new file-types then usually you will need to provide the specific module and type directives

Code:
LoadModule php5_module        /usr/local/apache2/modules/libphp5.so

AddType application/x-httpd-php .php

Maybe your install and or changes removed something? might be an idea to sdiff the original backed-up (default) httpd.conf against your running conf?

Good luck
Laurie.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top