airplane, buildings, perspective-1807486.jpg

List installed PHP packages on Ubuntu and Debian

If you have ever found yourself wondering what PHP packages are installed on a Debian or Ubuntu server you can run the following from the command line.

dpkg –get-selections

dave@darkmetal:~$ dpkg –get-selections | grep php
libapache2-mod-php5 install
php-pear install
php5-cli install
php5-common install
php5-curl install
php5-dev install
php5-gd install
php5-mcrypt install
php5-memcached install
php5-mysql install
php5-xdebug install
phpmyadmin install

In my example I am piping the output through grep to only show packages with PHP in their names.

If PEAR is installed you can get a list of packages installed with the following command:

pear list

dave@darkmetal:~$ pear list
Installed packages, channel
Package Version State
Archive_Tar 1.3.7 stable
Console_Getopt 1.3.0 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable

1 thought on “List installed PHP packages on Ubuntu and Debian”

Comments are closed.

Scroll to Top