I've been hosting websites on Ubuntu for a while. I use webmin/virtualmin to setup the environment without having to worry about command lines. Now I am trying to get better understanding about the whole process, and my question comes from the following command:
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
When I search for how to install PHP, most articles just give this command without further explanation. I understand what sudo apt-get install
does, if it's up to me myself, I would only know to do sudo apt-get install php
but not the other items(are they called module?). So where in the first place does ppl get to know that they need to install those other things? There should be an official manual or instruction telling ppl something like "in order for PHP to run, not only you need to install PHP, but also libapache2-mod-php/php-mcrypt/php-mysql etc.". Where is it? I'd like to read it for learning purpose.
Secondly, there are many different PHP versions atm, using this command, what version would be installed? And if I have to do "sudo apt-get install php5.6" do I need to put in the version number for the rest of the command? During my learning of Ubuntu, I've always felt that there are too many factors like this that leaves me clueless and greatly increase the complexity and frustration. Is there any basic principals that I can follow so I can conduct my own command-line without having to do a lot of googling every time?
apt install php
will use the latest version automatically. Right now this is php7 – derHugo Jul 26 '17 at 21:28