If your server only has a single PHP version installed, you can run this PHP command anywhere, and it will give you the same list of modules. The general command we will be using is php -m. This command will give you the full list of installed PHP modules/extensions.
The general command is php -m , which will show you a list of all “compiled” PHP modules. You can search for a specific PHP module for instance php-ftp , using the grep command.
Running
php -mwill give you all the modules, and
php -iwill give you a lot more detailed information on what the current configuration.
Run command. You will get installed extentions:
php -r "print_r(get_loaded_extensions());"
Or run this command to get all module install and uninstall with version
dpkg -l | grep php5
You want to run:
php -m
on the command line,
or if you have access to the server configuration file open
/etc/php5/apache2/php.ini
and look at all the the extensions,
you can even enable or disable them by switching between On and Off like this
<Extension_name> = <[On | Off]>
use get_loaded_extensions()
PHP function
<?php
echo "<pre>";
print_r(get_loaded_extensions());
echo "<pre/>";
?>
If you want to test if a particular extension is loaded you can also use the extension_loaded
function, see documentation here
php -r "var_dump(extension_loaded('json'));"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With