How to List Compiled PHP Modules from Command Line

Pre-Flight Check
  • These instructions are intended specifically for listing compiled PHP modules from the command line.
  • I’ll be working from an XWEB Core Managed CentOS 6.5 server, and I’ll be logged in as root. That said, these instructions will work on any server where PECL and PEAR are installed.

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
mongo
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 mongo

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

  • 387 Корисниците го најдоа ова како корисно
Дали Ви помогна овој одговор?

Понудени резултати

How to Install or Uninstall PECL Extensions

Pre-Flight Check These instructions are intended specifically for installing or uninstalling...

How to Install the MongoDB PHP Driver (Extension) on CentOS 6

Step 1: Setup Environment, Install PHP Extension & Application Repository (PEAR) As a matter...

How to Add a User and Grant Root Privileges on CentOS 6.5

Step 1: Add the User It’s just one simple command to add a user. In this case, we’re...

How to Add a User and Grant Root Privileges on Ubuntu 14.04

Step 1: Add the User It’s just one simple command to add a user. In this case, we’re...

How to Add a User and Grant Root Privileges on Ubuntu 12.04

Step 1: Add the User It’s just one simple command to add a user. In this case, we’re...