1

Each time I create a new Ubuntu server environment I also execute:

apt-get upgrade php-mbstring php-mcrypt php-curl php-cli php-gd

Instead all these php-something, is there one "formal" or "communally-supported" "meta-package" that includes all common php packages in one go?

I don't think I care installing all formal php packages as I don't think it should be a security problem if all were peer reviewed on the Ubuntu repositories and it might not necessarily take much SSD space.

I would prefer a version-agnostic way.

0

2 Answers 2

1

I know the trick, its not advisable.

sudo apt install php7.2 php-*

That is php(version you want) then php-(any meta package).

Before doing that lets check how many packages are their in php. Run

sudo apt policy php-*

Sorry I can't post you the response here because its report of approx 1.7M line.

If that machine had 1 gb ram. I am sure that you it won't start again or apache2 won't start. This the same reason why php is spited into these many extensions.So kindly consider to install only the extensions that are required.

2
  • Thank you, please see my updates about a version agnostic way.
    – user423047
    Nov 8, 2018 at 21:17
  • Also I got a 3273 lines anyway but maybe is just because I'm using WSL.
    – user423047
    Nov 8, 2018 at 21:21
0

If you want to write just one command that will install whatever you need in the future, you can create a shell script and save it in the cloud or wherever you want and whenever you install an new system just run the script. First, the most common is to write a file, make sure the first line is

#!/bin/bash

Then save the file. Next mark it executable using chmod +x yourFile then the following lines execute whatever you want like this

sudo apt-get update && sudo apt install blah blah && sudo apt-get upgrade php-curl blah blah

Then when you click (or run the file from the terminal) the commands will be executed. By convention these files usually have no extension, however you can make them end in .sh or any other way.

You must log in to answer this question.