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/libphp5.so

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:

        ServerAdmin webmaster@domain.com
        ServerName domain.com
        ServerAlias www.domain.com
        DocumentRoot /var/www/domain.com/public_html/
        ErrorLog /var/www/domain.com/logs/error.log
        CustomLog /var/www/domain.com/logs/access.log combined
        Options -indexes
  • Maybe something in /var/www/domain.com/logs/error.log?
    – azat
    Feb 26, 2011 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). Feb 26, 2011 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, 2011 at 23:52
  • Running into the same problem after a recent system upgrade. Ever figure this out?
    – zigdon
    May 23, 2011 at 23:25

2 Answers 2


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.


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

  • 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, 2011 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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