# dl and extension directive in php.ini

- Thread: https://externals.io/message/1134
- Original archive: https://news-web.php.net/php.internals/1134
- Started by Hans Zaunere on 2003-05-01T20:13:33+00:00
- Messages: 3
- 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

---

## #1134 — Hans Zaunere — 2003-05-01T20:13:33+00:00

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

Hello,

I'm hearing some conflicting reports and I'd like to see other's thoughts on
this.

Loading an external module using `dl()` at runtime obviously loads the module
per request (ie, performance hit).

On the other hand, which I believe is the recommended method anyway, is using
the extension= directive in php.ini.  While this is still a dynamic module
load, it should only happen once; for instance when the Apache child process
is forked.  However, while reading some Zend API docs I began to doubt this,
so I'm interested in some confirmations.

Basiclly, I'm of the understanding that `dl()` is 'bad' anyway, so I guess the
question really is: when specifying a dynamic module (.so) from php.ini, does
it get loaded per request or at process creation time?

Thanks,

H

---

## #1135 — Derick Rethans — 2003-05-01T20:14:47+00:00

URL: https://externals.io/message/1134#1135 · In reply to: #1134

Hello Hans,



> Basiclly, I'm of the understanding that `dl()` is 'bad' anyway, so I guess the
> question really is: when specifying a dynamic module (.so) from php.ini, does
> it get loaded per request or at process creation time?

Per process creation.

Derick

-- 
                                        "my other box is your windows PC"
-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals       http://php-mag.net/

---

## #1136 — Rasmus Lerdorf — 2003-05-01T20:17:25+00:00

URL: https://externals.io/message/1134#1136 · In reply to: #1134

> On the other hand, which I believe is the recommended method anyway, is using
> the extension= directive in php.ini.  While this is still a dynamic module
> load, it should only happen once; for instance when the Apache child process
> is forked.  However, while reading some Zend API docs I began to doubt this,
> so I'm interested in some confirmations.

Not sure what you are reading, but yes, if you use extension=foo.so in 
your php.ini file, then foo.so is only loaded at server startup time.  
However, due to funky Apache startup stuff, it is actually loaded, 
unloaded and then loaded again at startup, but from then on there is no 
per-request loading or unloading as there is with `dl()`.

-Rasmus
