Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 mydomain.com/index.php 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
add comment

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.

1 Answer

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/libphp5.so
</IfModule>

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
add comment

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