1

During the process of setting up a new development workstation (Kubuntu 18.10), I discovered that the php-cli package was not installed. Nevertheless, all PHP scripts are working fine, whether they are run through the webserver or standalone (for example from cron).

I installed PHP using apt install php. This created a php.ini and a conf.d directory in /etc/php/7.2/cli. On the terminal, the path for the PHP executable is /usr/bin/php, which links to /etc/alternatives/php, which links to the actual binary, /usr/bin/php7.2. The MD5-sum of this file is the same with the php-cli package installed or removed.

I remember there used to be a time when php-cli was required for standalone scripts, but what does it do now? Is there any point in installing it, if the php package is already installed?

4
  • see github.com/splitbrain/php-cli – Rinzwind Apr 7 '19 at 15:20
  • see github.com/splitbrain/php-cli – Rinzwind Apr 7 '19 at 15:20
  • I don't think that's the same software. The description of the Ubuntu package reads "This package provides the /usr/bin/php7.2 command interpreter". But your comment did help me figure out what's actually going on. – Zilk Apr 7 '19 at 16:17
  • sure but it explains what it is ;) – Rinzwind Apr 7 '19 at 16:20
0

I must be blind, sorry: php-cli depends on php7.2-cli, which was automatically installed when I installed the php package. I missed that when I filtered the packages using "php-".

So the answer is: no, there is no point in installing php-cli after php, as nothing new would be added. In theory, it might be useful if I ever uninstall php or libapache2-mod-php7.2, as the CLI part would still be kept.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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