How to Find Where the Php Module Is Installed

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.

# php -m        

Listing Compiled PHP Modules

apc bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv json libxml mbstring mcrypt mysql mysqli openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar readline Reflection session shmop SimpleXML sockets SPL sqlite3 standard tidy tokenizer wddx xml xmlreader xmlwriter xsl zip zlib        

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 FTP instead of ftp should work).

# php -m | grep -i ftp          ftp        

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.

# yum list installed | grep -i php		#RHEL/CentOS # dnf list installed | grep -i php		#Fedora 22+ # dpkg --get-selections | grep -i php		#Debian/Ubuntu        

Listing Installed PHP Modules

php.x86_64                         5.3.3-49.el6                        @base     php-cli.x86_64                     5.3.3-49.el6                        @base     php-common.x86_64                  5.3.3-49.el6                        @base     php-devel.x86_64                   5.3.3-49.el6                        @base     php-gd.x86_64                      5.3.3-49.el6                        @base     php-mbstring.x86_64                5.3.3-49.el6                        @base     php-mcrypt.x86_64                  5.3.3-5.el6                         @epel     php-mysql.x86_64                   5.3.3-49.el6                        @base     php-pdo.x86_64                     5.3.3-49.el6                        @base     php-pear.noarch                    1:1.9.4-5.el6                       @base     php-pecl-memcache.x86_64           3.0.5-4.el6                         @base     php-php-gettext.noarch             1.0.12-1.el6                        @epel     php-tidy.x86_64                    5.3.3-49.el6                        @base     php-xml.x86_64                     5.3.3-49.el6                        @base        

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

# yum list installed | grep -i php-mbstring		#RHEL/CentOS # dnf list installed | grep -i php-mbstring		#Fedora 22+ # dpkg --get-selections | grep -i php-mbstring	        #Debian/Ubuntu        

To view all php command line options, run.

# php -h        

You might also like to check out these following useful articles about PHP.

  1. 12 Useful PHP Commandline Tricks Every Linux User Should Know
  2. How to Use and Execute PHP Codes in Linux Command Line
  3. How to Install Different PHP Versions in Ubuntu
  4. How to Install OPCache to Speed Up Performance of PHP Apps

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.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

How to Find Where the Php Module Is Installed

Source: https://www.tecmint.com/list-php-modules-in-linux/#:~:text=The%20general%20command%20is%20php,all%20%E2%80%9Ccompiled%E2%80%9D%20PHP%20modules.&text=You%20can%20search%20for%20a,ftp%20%2C%20using%20the%20grep%20command.

0 Response to "How to Find Where the Php Module Is Installed"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel