The dl()
function in PHP is used to dynamically load a PHP extension at runtime within a script, allowing the inclusion of a shared library or extension file that extends PHP functionality.
However, it poses potential security vulnerabilities due to its capacity to load arbitrary or malicious code. For this reason, the dl()
function is disabled by default on our Web and Cloud hosting plans.
If necessary, you can manually enable the dl()
function from your hPanel. We recommend considering the following precautions:
Ensure you're using the latest PHP version available
Implement strict input validation and sanitization measures to safeguard against potential security threats
Limit the use of
dl()
exclusively to specific directories or scripts that require dynamic loading of extensions
While these precautions can help reduce the risks associated with using dl()
, it's generally advisable to avoid its usage and, if possible, seeking alternative solutions to maintain a more secure hosting environment.
Additional Resources