# Apache2 patch sanity check

- Thread: https://externals.io/message/17260
- Original archive: https://news-web.php.net/php.internals/17260
- Started by Rasmus Lerdorf on 2005-07-14T08:19:35+00:00
- Messages: 2
- 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

---

## #17260 — Rasmus Lerdorf — 2005-07-14T08:19:35+00:00

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

This patch is to fix http://bugs.php.net/33690 which is caused by the
fact that php_handler() in sapi/apache2handler/sapi_apache.c calls
apply_config() well before it has allocated SG(server_context) and set
ctx->r to the current request_rec.  Downstream from that any ini handler
that needs something from SG(server_context) is thus out of luck.
Following the chain up the backtrace in bug #33690 should make that very
clear if you didn't follow my bad explanation.

So, this patch simply moves the allocation of the context up before the
call to apply_config().  It's not my sapi, and I still don't run Apache2
in anger anywhere, so I'd appreciate a quick sanity check.

-Rasmus

---

## #17261 — Rasmus Lerdorf — 2005-07-14T08:22:49+00:00

URL: https://externals.io/message/17260#17261 · In reply to: #17260

Rasmus Lerdorf wrote:
> This patch ...

Ah, crap, an unrelated sapi_get_request_time backport patch snuck in
there.  Here is the clean patch.
