Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Apache not parsing files? Just sending downloads


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


How should I configure my vhost to process PHP files?


My vhost configuration:

Listen 8010

<VirtualHost *:8010>
   DocumentRoot /srv/www/
   ErrorLog /srv/www/
   CustomLog /srv/www/ combined

   DirectoryIndex index.html index.php

   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps

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 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.

1 Answer 1

Ensure that mod_php is installed and enabled.

share|improve this answer

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