PHP modules (extensions) can only be loaded in the startup-phase of PHP. For example it is not possible to load them with .user.ini
files. The extension
directive for example is php.ini only.
This is a hint - historically .user.ini
files were not in core, but per-directory .htaccess settings for the SAPI for Apache mod_php.
To circumvent this restriction in the past, the dl()
function had been introduced to dynamically load extensions at run-time. However only if enabled, so the enable_dl
directive.
However support for dl
has been largely disabled in current PHP SAPIs, having it available only in CLI and Embed.
As you haven't been said why you're curious about dl()
the best answer I can give, is that it is useful for esoteric reasons only. Most likely it's even useless with the SAPI you want to use it with (you have not shared the SAPI name, but I guess it's not CLI nor Embed).