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

We are hosting several sites on our server. We have set a custom not_found.php file in the apache config and it works fine.

For a few of our virtual hosts, we need a custom not_found.php file. In the <VirtualHost> section we have set a custom 404 file. When we try to access a non-existing url in that virtual host, we get a "File not found" error (not the typical Firefox 404 Not Found).

If we rename the file to .html and change it to .html in the config, it loads the custom 404 just fine (the PHP scripting doesn't work of course). So I know it is reading the custom ErrorDocument statement in the VirtualHost. And I know the path is fine. It just doesn't work with an extension of .php.

Here is the relevant config:

    Alias "/error_docs" "/var/www/vhosts/"
    ErrorDocument 404 /error_docs/not_found.php

PS. PHP scripts work throughout the sites (so we know PHP is working fine).

Any ideas?

share|improve this question
up vote 0 down vote accepted

I figured this out. Someone had specifically turned off PHP for the error_docs folder using

php_admin_flag engine off

It was hidden away and I just happened to find it today.

share|improve this answer

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.