# adding apache2 ErrorDocument 500 support

- Thread: https://externals.io/message/43758
- Original archive: https://news-web.php.net/php.internals/43758
- Started by Jeremy Jackson on 2009-04-22T21:27:51+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #43758 — Jeremy Jackson — 2009-04-22T21:27:51+00:00

URL: https://externals.io/message/43758#43758

In looking into setting custom ErrorDocument with apache2, I see from
NEWS file:

30 Aug 2007, PHP 5.2.4
- Changed error handler to send HTTP 500 instead of blank page on PHP errors.
  (Dmitry, Andrei Nigmatulin)

And indeed it seems that the PHP core now sets it in main/main.c line
985, but the SAPI apache2handler can only return status 404
HTTP_NOT_FOUND, HTTP_FORBIDDEN, DECLINED or OK to apache2 core in
sapi/apache2handler/sapi_apache2.c around line 499 function
php_handler().

Would it be possible for the SAPI for apache2 to return
HTTP_INTERNAL_SERVER_ERROR, so that Apache2's ErrorDocument can be
triggered on `E_PARSE` errors?


-- 
Jeremy Jackson
Coplanar Networks
(519)489-4903
http://www.coplanar.net
jerj@coplanar.net
