Check whether a PHP extension is loaded or not

How to figure out whether PHP extension is loaded or not on your page?


Usually in phpinfo() doesn’t show you all the loaded extensions in one location, it has got a separate section for each loaded extension where it shows all of its variables, file paths, etc so if there is no section for your extension name it probably means it isn’t loaded.


You can also check by below PHP function, if you know the exact name of PHP extension.


//gd represented GD Library as you usual say
if (!extension_loaded(‘gd’)) {
if (!dl(‘’)) {

Returns Boolean value true if the extension loaded and false otherwise .

Some other PHP extension related functions are


Returns an array with the names of all modules compiled and loaded


Returns an array with the names of the functions of a module


Loads a PHP extension at runtime


Note: dl() is disables in some environment and it will also disabled in PHP Safe Mode.