Are there potential security risks or limitations when using the dl() function with PHP installed as CGI?

When using the dl() function with PHP installed as CGI, there can be potential security risks as it allows dynamic loading of PHP extensions at runtime, which can lead to vulnerabilities if not properly secured. To mitigate these risks, it is recommended to avoid using the dl() function altogether and instead statically compile the necessary extensions into PHP or use the php.ini file to load extensions.

// Avoid using dl() function with PHP installed as CGI
// Instead, statically compile extensions into PHP or load them in php.ini

// Example of loading extension in php.ini
// extension=my_extension.so