# Module activation order in php_request_startup()

- Thread: https://externals.io/message/14229
- Original archive: https://news-web.php.net/php.internals/14229
- Started by Moriyoshi Koizumi on 2004-12-29T04:56:37+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

---

## #14229 — Moriyoshi Koizumi — 2004-12-29T04:56:37+00:00

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

Hi,

Currently activation functions are called in the following order
on request startup:

1. zend_activate()
2. sapi_activate()
3. php_hash_environment()
4. zend_activate_modules()

Is there any good technical reason behind this order? I don't think
it does make much sense because php_hash_environment() can call
input handlers before the modules providing those handlers are
initialised.

It also resulted in a fatal bug in mbstring reported recently
in the Japanese user's mailing list; some settings kept in the
module globals leak over requests.

Regards,
Moriyoshi

---

## #14234 — Andi Gutmans — 2004-12-30T01:49:11+00:00

URL: https://externals.io/message/14229#14234 · In reply to: #14229

It probably has to do with the fact that the sessions module requires the 
COOKIEs to be already initialized. I think that was the main reason why we 
separated zend_activate and zend_activate_modules.

Andi

At 01:56 PM 12/29/2004 +0900, Moriyoshi Koizumi wrote:
>Hi,
>
>Currently activation functions are called in the following order
>on request startup:
>
>1. zend_activate()
>2. sapi_activate()
>3. php_hash_environment()
>4. zend_activate_modules()
>
>Is there any good technical reason behind this order? I don't think
>it does make much sense because php_hash_environment() can call
>input handlers before the modules providing those handlers are
>initialised.
>
>It also resulted in a fatal bug in mbstring reported recently
>in the Japanese user's mailing list; some settings kept in the
>module globals leak over requests.
>
>Regards,
>Moriyoshi
