pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

PHP Install Packages

Tue Jun 09, 2020 8:50 am

I just require command line PHP, the standard PHP package also loads apache2 so I tried the CLI package (php7.3-cli) but unfortunately this comes without many of the normal modules (eg cURL, GD etc). I know I can install the modules separately but don't want to have to go through that with every version change of PHP

Is there a package with all the "normal" modules or should I go with the standard package and remove apache2 afterwards? I have had problems removing packages when part of the original package has been removed - or perhaps I'm doing things in completely the wrong way.

Why does installing PHP install apache2 anyway - that is a strange enforcement?

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: PHP Install Packages

Tue Jun 09, 2020 9:02 am

apache2 gets installed as it is a "recommended" package to add when libapache2-mod-php7.3 is installed, which in turn is a dependency of php7.3-cli. I always set up apt to not install the "Recommended" packages, so I don't get that one installed.

You can do this by adding --no-install-recommends to the apt install command line, or make it default by creating a file in /etc/apt/apt.conf.d/ called something like "90no-recommends" with this content

Code: Select all

APT::Install-Recommends "false";
Unreadable squiggle

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: PHP Install Packages

Tue Jun 09, 2020 9:23 am

Thank you for an excellent reply, I hadn't latched on to recommends being entirely optional and was thinking that they were more like includes/requires.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: PHP Install Packages

Tue Jun 09, 2020 9:42 am

pidd wrote:
Tue Jun 09, 2020 9:23 am
Thank you for an excellent reply, I hadn't latched on to recommends being entirely optional and was thinking that they were more like includes/requires.
There was a change in Debian policy on this many years ago (which I don't fully agree with). Prior to that "Recommends" packages weren't installed by default. Now they are. It's only "Suggests" that don't get installed now.
Unreadable squiggle

Return to “Other programming languages”