Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
What causes PHP pages to consistently download instead of running normally

All php files on my website are prompting direct download instead of viewing the page.

So for example: going to in browser will direct download the index.php file.

All my files are completely naked to the public.

I'm not sure how this happened, how can i trouble shoot this?

I am using linux, centos, with cPanel. My htaccess file is empty.

share|improve this question

marked as duplicate by quanta, Bart De Vos, Ward, Scott Pack, Ladadadada Jul 17 '12 at 15:29

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.

up vote 2 down vote accepted

You probably don't have the php module loaded for Apache :

Try the following command

apachectl -M

In the output you should see

 php5_module (shared)

If you don't: 1. make sure php is installed 2. It is enabled in the Apache configuration files:

more /etc/httpd/conf.d/php.conf

<IfModule prefork.c>
  LoadModule php5_module modules/

AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php

Since you are using CPanel you should be able to enable for your server through the CPanel configuration options.

share|improve this answer

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