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

7 posts / 0 new
Last post
#1 Sat, 08/08/2009 - 13:24
pcm2a

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 http://domain.com/index.php (I've specified index.php in the address). This works perfectly.

So php is working but when you just go to http://domain.com 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?

Thanks!

Sat, 08/08/2009 - 18:24
ronald
ronald's picture

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.

Sat, 08/08/2009 - 20:17
pcm2a

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.

Fri, 09/25/2009 - 17:11 (Reply to #3)
barry.breaux

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

Index.php is listed in Directory Indexing.

Thanks!

Sun, 09/27/2009 - 03:48
vfclists

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.

Sun, 09/27/2009 - 10:01 (Reply to #5)
andreychek

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.

-Eric

Sun, 09/27/2009 - 08:44
arjones85

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

Topic locked