CentOS Debian Fedora FreeBSD Linux PHP Tips and Tricks Troubleshooting Ubuntu

How to List Compiled PHP Modules from the Command Line

The general command is php -m; this command will give you the full list of extensions:

php -m

This command will give you an output like:

 bz2
 calendar
 Core
 ctype
 curl
 date
 ereg
 exif
 fileinfo
 filter
 ftp
 gettext
 gmp
 hash
 iconv
 json
 libxml
 openssl
 pcntl
 pcre
 Phar
 readline
 Reflection
 session
 shmop
 SimpleXML
 sockets
 SPL
 standard
 tokenizer
 xml
 zip
 zlib

If you’re looking for one particular item then use a pipe and the grep command:

php -m | grep -i curl

In the case above, I “grep’d” looking for the PHP module curl; replace curl with the name of the module you’re searching for!

Related Articles

  • Setting files as immutable.

    Wouldn’t it be nice if we can set files so that even root cannot modify or delete it ? Both FreeBSD and Linux come with commands that allows us to...
  • Disable SELinux

    Security-Enhanced Linux (SELinux) is a mandatory access control (MAC) security mechanism implemented in the Linux kernel. This mechanism adds an extra layer of access security to your files,directories,devices, ports and...
  • How to get rid of ^M characters.

    When you edit a file in Windows and then open in UNIX, you must have seen ^M characters getting appended in the content. How to get rid of it ?...
  • Identify the process that is using some specific port

    Sometimes, you may encounter a situation where you see some ports being used by some service, but you cannot exactly determine which application/service is using it. This article talks about how...