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:
Apache not parsing files? Just sending downloads

Description

Now I have setup up a site in Apache using vhost. If I request something it response me a PHP file raw.

Question

How should I configure my vhost to process PHP files?

Stage

My vhost configuration:

Listen 8010

<VirtualHost *:8010>
   ServerAdmin webmaster@mysite.org
   ServerName mysite.org
   ServerAlias www.mysite.org
   DocumentRoot /srv/www/mysite.org/public_html/
   ErrorLog /srv/www/mysite.org/logs/error.log
   CustomLog /srv/www/mysite.org/logs/access.log combined

   DirectoryIndex index.html index.php

   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps
</VirtualHost>

If I request some page it throws me PHP raw file, I have tested this using curl:

$ curl -I http://localhost:8010/index.php
HTTP/1.1 200 OK
Date: Mon, 15 Oct 2012 20:20:31 GMT
Server: Apache/2.2.16 (Debian)
Last-Modified: Thu, 03 May 2012 16:41:59 GMT
ETag: "48b6a-2871-4bf247b86c3c0"
Accept-Ranges: bytes
Content-Length: 10353
Content-Type: application/x-httpd-php
share|improve this question

migrated from stackoverflow.com Oct 16 '12 at 0:26

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Ward, Iain Oct 20 '12 at 8:04

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.

add comment

1 Answer

Ensure that mod_php is installed and enabled.

share|improve this answer
add comment

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