How do I from PHP code if a PECL extension is installed or not?
I want gracefully handle the case when an extension is not installed.
I think the normal way would be to use extension-loaded.
if (!extension_loaded('gd')) {
// If you want to try load the extension at runtime, use this code:
if (!dl('gd.so')) {
exit;
}
}