Search code examples
phpruntimephp-extension

unloading php extensions : reverse dl()


To you gurus out there, is there any hidden gem in PHP that could unload a specific extension at runtime ?


Solution

  • No, that's not possible and most likely never will:

    [2011-02-08 11:34 UTC] [email protected]
    extension unloading on a per-request basis simply isn't feasible from a performance point of view. And you obviously can't unload and leave it unloaded for the next request because that next request may be for a page that expects the extension to be there.

    However, using dl() is discouraged anyway - and in recent versions it is only available in the CLI version.