What causes PHP pages to consistently download instead of running normally

Posted by Jonathan on Server Fault See other posts from Server Fault or by Jonathan
Published on 2010-12-22T15:34:45Z Indexed on 2010/12/22 20:56 UTC
Read the original article Hit count: 231

Filed under:
|
|
|
|

Hi,

I'm running a Ubuntu Server on a VM, to test out different web forum solutions. I have set up a ~/public_html/ to be accessible with the apache2 web server, and that works fine.

However when I go to a .php file on a browser (using my VM's ip-address/~username/phpfile.php) it does not display it as it should. Instead it offers to save to file/asks what program to open it with. Interestingly though that dialog box does recognise that it is a php file.


I have the following version of php installed on the system:

PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch (cli) (built: Sep 17 2010 13:49:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

And the following server:

Server version: Apache/2.2.14 (Ubuntu)
Server built:   Nov 18 2010 21:19:09


If anyone knows what might be causing this/potential solutions it would make me very happy :)

EDIT: Turns out files this behaviour was only apparent on files in the ~/public_html/ directory. All php files in /var/www/ work fine.

Prizes go to whoever can explain why? :D (And by prizes I just mean a well done, no actual prizes I'm afraid.)

© Server Fault or respective owner

Related posts about php

Related posts about apache