New vhost, index.php tries to download instead of display

Weird problem I’m getting… I have 5 domains running in Virtialmin perfectly. I added a new one yesterday and let the client start uploading his stuff and what not.

The problem is if you only put one single file in the web directory “index.php”, instead of that page being shown it pops up a download box wanting me to download a “application/x-httpd-php” file.

I save that file and open it up and it is the contents of the index.php file.

Now, to make sure php is working on this vhost I try going to (I’ve specified index.php in the address). This works perfectly.

So php is working but when you just go to you get a download box.

Without just deleting the vhost and starting over, is there anything I can check to see what went wrong or anything that would have caused this?


See that in the apache config for that domain in the Directory Indexing, the index.php is mentioned. Also that dns is correctly configured, sometimes when the browser needs a long time, then it wants to download the file instead of opening it.

DirectoryIndex looks ok:

DirectoryIndex index.html index.htm index.php index.php4 index.php5

The save box pops up instantly. Not sure what to check with the DNS.

I’m having the same problem after an upgrade. Would be interested in a solution.

Index.php is listed in Directory Indexing.


Is there a bug in this particular apache build?

When I try to run

apache2 -t -D DUMP_VHOSTS

I get this error

apache2: bad user name ${APACHE_RUN_USER}

The other options appear to run fine.

Verify that the correct content handlers are in place for php files.

Sounds like you’re using Ubuntu or Debian – you’ll need to use the Apache init script or the apache2ctl program in order to launch Apache.

If you need to pass in special arguments, you should be able to add them in by temporarily setting the “APACHE_ARGUMENTS” variable in /etc/apache2/envvars.