How to List Compiled and Installed PHP Modules in Linux

Linux

If you have installed a number of PHP extensions or modules on your Linux system and you trying to find out a particular PHP module has been installed or not, or you simply want to get a complete list of installed PHP extensions on your Linux system.

In this article, we will show you how to list all installed or compiled PHP modules from Linux command line.

How to List Compiled PHP Modules

The general command is php -m, which will show you a list of all “compiled” PHP modules.

Listing Compiled PHP Modules

You can search for a specific PHP module for instance php-ftp, using the grep command. Simply pipe the output from the above command to grep as shown (grep -i flag means ignore case distinctions, thus typing FTPinstead of ftp should work).

How to List Installed PHP Modules

To list all PHP modules that you have installed via a package manager, use the appropriate command below, for your distribution.

Listing Installed PHP Modules

In case you want to find one particular module, like before, use a pipe and the grep command as shown.

To view all php command line options, run.

That’s all! In this article, we’ve explained how to list installed (or compiled in) modules in PHP. Use the comment form below to ask any questions.

Source

Share: