Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've run into a problem with my Apache 2.2.16 configuration, running on Debian Squeeze. The problem is that it stopped serving PHP5-scripts completely. When I try to access the sites with Google Chrome, it instead downloads a file called "download", which contains the contents of the script. This is of course not a good thing. It does serve common html-files perfectly...

I've been at this for quite a while now, and after all the googling and troubleshooting, I thought it would be a good time to ask you guys. Here's what I've got:

  1. The php5 and libapache2-mod-php5 packages are installed
  2. /etc/apache2/mods-available contains both php5.load and php5.conf, and these are symlinked from the mods-enabled directory
  3. The /etc/php5/ directory is left untouched since the installation.

Here's the contents of /etc/apache2/mods-available/php.load:

LoadModule php5_module /usr/lib/apache2/modules/

And /etc/apache2/mods-available/php.conf:

<IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler application/x-httpd-php
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off

What am I missing? This is a server with modified virtual hosts and the like, so I might have changed some settings which causes this problem, but simply purging and reinstalling is not an option so far, since the configuration is quite extensive. Any help would be great. Thanks.

Edit: I'm trying to access the scripts running in virtual apache hosts, under /var/www/. The configuration for those look like this:

        DocumentRoot /var/www/
        ErrorLog /var/www/
        CustomLog /var/www/ combined
        Options -indexes
share|improve this question

migrated from Feb 26 '11 at 14:59

This question came from our site for computer enthusiasts and power users.

Maybe something in /var/www/ – azat Feb 26 '11 at 21:50
Just to make sure, 'apache2ctl -M' lists the php5_module amongst others? I ask because of the 'from' in your 2. "..these are symlinked from the mods-enabled directory.." (the links should go from avail to enabled). – desasteralex Feb 26 '11 at 22:10
Ah, that was my mistake. They are symlinked from sites-available, to sites-enabled. 'apache2ctl -M' includes "php5_module (shared)". – cmbrnt Feb 26 '11 at 23:52
Running into the same problem after a recent system upgrade. Ever figure this out? – zigdon May 23 '11 at 23:25

You could try removing the entire php_admin_value engine Off setting, perhaps you are unexpectedly matching the scripts. Does FilesMatch do case-insensitive matching? Perhaps check the syntax of your regexps?

How is php.conf being loaded? Double check that it is being loaded correctly.

share|improve this answer

Where are you trying to access the php script from? I'm guessing somewhere in /home/*/public_html?

I believe php_admin_value engine Off will turn off the engine value in php.ini.. and per the php.ini commments, it should be on:

; Enable the PHP scripting language engine under Apache.
engine = On

What happens if you change php_admin_value engine Off to php_admin_value engine On

share|improve this answer
I added some clarification in the original post. I'm not running anything in the home directories, but under /var/www/<site>/public_html. – cmbrnt Feb 26 '11 at 17:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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