How to list the PHP modules installed on your system?

Windows Articles

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
angeloma
angeloma
Senior Writer and partner

In this blog, we like the topic of servers and the multiple applications that we can install on it. Some of them are very professional and dedicated to a very specific user sector, but others are more common. Well, many of these server applications have a web environment, and the web is dominated by PHP. Now, how do we know which PHP modules are in our system? Well in this post, learn how to list the PHP modules installed on your system. So when you want to install other programs you know which modules are missing.

List the PHP modules installed on your system

This post, will list the modules installed either from the official repositories of your distribution or compiled manually. So you will be able to detail them all indistinctly as they were installed.

To do this, open a terminal and run the following command:

php -m

And there will be a screen output similar to this one:

[PHP modules]
.
.
.
ctype
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
.
.
.

We can combine this command with the grep command to filter the modules. For example, if we want to search exactly for mbstring, we can follow the following syntax

php -m | grep -i mbstring
mbstring

Remember that the -i option makes the search case insensitive.

Another way to do it

Linux is great because it allows you to do the same process in different ways. So, we can also use DNF and APT for that, depending on the distribution you use.

In the case of DNF which is the Fedora, CentOS, RHEL and derivatives package manager, open a terminal and run:

sudo dnf list installed | grep -i php

or using the RPM command:

rpm -qa | grep -i php

In case you use Debian, Ubuntu, Linux Mint or any derivative of these, then use dpkg in the following way:

dpkg --get-selections | grep -i php
Output:
.
.
.
php7.4-cli install
php7.4-common install
php7.4-fpm install
php7.4-gd
.
.
.

Similarly, you can combine this command with grep and perform filters.

So, this way you will know which are the PHP modules you have installed in your system

Conclusion

Thanks to this post, you can quickly find out which PHP modules you have in your system. This is very helpful in servers and also in computers where web applications are developed.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
x