The following message prompts when you just simply do: sudo apt-get install php, which basically installs all of the related php packages, I believe:

libapache2-mod-php7.2 php-common php7.2 php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline

Do I need to install all of these? My server Ubuntu prompted me to perform sudo apt install php7.2-cli. Most Sources online don't specify what the difference between the packages is?


You can issue apt-cache show PKG (or just apt show PKG) command to get package description, in this case we'll start by issuing the command to each package you want to know about.

  • libapache2-mod-php7.2

    This package provides the PHP module for the Apache 2 webserver (as found in the apache2-mpm-prefork package). Please note that this package ONLY works with Apache's prefork MPM, as it is not compiled thread-safe.

  • php-common

    This package contains common utilities shared among all packaged PHP versions.

  • php7.2-common

    This package provides the documentation, examples and common module(s) for PHP.

  • php7.2-cli

    This package provides the /usr/bin/php7.2 command interpreter, useful for testing PHP scripts from a shell or performing general shell scripting tasks.

  • php7.2-json

    This package provides the JSON module(s) for PHP.

  • php7.2-opcache

    This package provides the Zend OpCache module(s) for PHP.

  • php7.2-readline

    This package provides the readline module(s) for PHP.

If you plan to use apache as your webserver, then leave out as it be because by default apt will install apache integration with php— otherwise just installing php7.2-cli will get rid of apache dependencies for good.

Not the answer you're looking for? Browse other questions tagged or ask your own question.