dl()
dl - Loads a PHP extension at runtime
Syntax
int dl (
string $library)
Arguments
- library - This parameter is onlythe filename of the extension to load which also depends on your platform. For example, the socketsextension (if compiled as a shared module, not the default!) would be called sockets.soon Unix platforms whereas it is called php_sockets.dllon the Windows platform. The directory where the extension is loaded from depends on your platform: Windows - If not explicitly set in the php.ini, the extension is loaded from C:\php4\extensions\(PHP4) or C:\php5\(PHP5) by default. Unix - If not explicitly set in the php.ini, the default extension directory depends on whether PHP has been built with --enable-debugor not whether PHP has been built with (experimental) ZTS (Zend Thread Safety) support or not the current internal ZEND_MODULE_API_NO(Zend internal module API number, which is basically the date on which a major module API change happened, e.g. 20010901) Taking into account the above, the directory then defaults to <install-dir>/lib/php/extensions/ <debug-or-not>-<zts-or-not>-ZEND_MODULE_API_NO, e.g. /usr/local/php/lib/php/extensions/debug-non-zts-20010901or /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
Description
Loads the PHP extension given by the parameter library.
Version
PHP 4, 5
Return value
Returns TRUE on success or FALSE on failure. If the functionality of loading modules is not available or has been disabled (either by setting enable_dloff or by enabling safe modein php.ini) an E_ERROR is emitted and execution is stopped. If dl() fails because the specified library couldn't be loaded, in addition to FALSE an E_WARNING message is emitted.