ErrorDocument CGI not executing, source displayed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Apache HTTP server 2.2, the ErrorDocument has a PHP CGI script in my configuration which shows a nice message and reacts to multiple error codes and shows additional information for each. This works fine.

But after upgrading to version 2.4, it no longer executes. Instead, the full source code of that file is displayed, including the first line, see below. What's wrong here?

The config is pretty simple:

ErrorDocument 401 /cgi-bin/error.cgi
ErrorDocument 403 /cgi-bin/error.cgi
ErrorDocument 404 /cgi-bin/error.cgi
ErrorDocument 500 /cgi-bin/error.cgi

The file is owned by the correct user and group and is executable. It looks like this:

#!/usr/bin/php-cgi
<?
$errorCode = $_SERVER['REDIRECT_STATUS'];
$reqUrl = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
...

The access log contains the expected entry with the error code, like 500 or 403. The error log tells me that the client was denied in my restricted directory, with is also expected.

But why is the error document file not executed at all anymore?

Apache version is from 2.2.x to 2.4.7 on Ubuntu 14.04.

--
Yves Goergen
http://unclassified.de
http://dev.unclassified.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux