Commands I used to install Lamp

These are the commands that I used to install LAMP stack.

  1.  sudo apt-get install apache2
  2. sudo apt-get -y purge php5 libapache2-mod-php5 php5 php5-cli php5-common php5-curl php5-gd php5-imap php5-intl php5-json php5-mcrypt php5-mysql php5-pspell php5-readline php5-sqlite
  3. sudo apt-get install mysql-client mysql-server _ Here I had to give the root password to the installation. Very Important step. Skipped the hardening part.
  4. (Had already got this but to complete the steps)
    sudo apt-get install python-software-properties software-properties-common
  5. sudo add-apt-repository ppa:ondrej/php
  6. sudo apt-get update
  7. sudo apt-get install php7.2
  8. apt-get install php-pear php7.2-dev php7.2-zip php7.2-curl php7.2-gd php7.2-mysql php7.2-mcrypt php7.2-xml libapache2-mod-php7.2
    1. Here there was an issue with php7.2mcrypt, so removed that and installed the rest.
  9. (To install mcrypt module). sudo apt-get -y install gcc make autoconf libc-dev pkg-config
  10. sudo apt-get -y install libmcrypt-dev
  11. sudo pecl install –nodeps mcrypt-snapshot
  12. sudo bash -c “echo extension=mcrypt.so > /etc/php/7.2/cli/conf.d/mcrypt.ini”
  13. php7.2 -i | grep mcrypt

Well did manage to get the whole thing going.