
Posible duplicado:
¿Apache no analiza archivos? Solo enviando descargas
Descripción
Ahora he configurado un sitio en Apache usando vhost. Si solicito algo, me responde un archivo PHP sin formato.
Pregunta
¿Cómo debo configurar mi vhost para procesar archivos PHP?
Escenario
Mi configuración de servidor virtual:
Listen 8010
<VirtualHost *:8010>
ServerAdmin [email protected]
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>
Si solicito alguna página, me arroja un archivo PHP sin formato, lo he probado usando 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
Respuesta1
Asegúrese de que mod_php esté instalado y habilitado.