What's the difference between the following php packages? [duplicate]
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-readlineDo 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?
1 Answer
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.2This 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-commonThis package contains common utilities shared among all packaged PHP versions.
php7.2-commonThis package provides the documentation, examples and common module(s) for PHP.
php7.2-cliThis package provides the
/usr/bin/php7.2command interpreter, useful for testing PHP scripts from a shell or performing general shell scripting tasks.php7.2-jsonThis package provides the JSON module(s) for PHP.
php7.2-opcacheThis package provides the Zend OpCache module(s) for PHP.
php7.2-readlineThis 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.