Search code examples
phpphp-extension

php dl() for loading extensions is removed from some SAPIs


I'm reading on the dl() function (which lets you load extensions manually), and the php documentation says

WARNING: This function has been removed from some SAPI's in PHP 5.3.

Does anyone know what this means. SAPI seems to mean Server API, but I'm not sure what exactly this means.


Solution

  • That very page says

    The only SAPI's that allow dl() are: CLI, CGI and Embed. Use the Extension Loading Directives instead.

    You can determine what sapi you are using with php_sapi_name(). At least for me, running it on the command line returns "cli."