These are the commands that I used to install LAMP stack.
- sudo apt-get install apache2
- 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
- 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.
- (Had already got this but to complete the steps)
sudo apt-get install python-software-properties software-properties-common - sudo add-apt-repository ppa:ondrej/php
- sudo apt-get update
- sudo apt-get install php7.2
- 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
- Here there was an issue with php7.2mcrypt, so removed that and installed the rest.
- (To install mcrypt module). sudo apt-get -y install gcc make autoconf libc-dev pkg-config
- sudo apt-get -y install libmcrypt-dev
- sudo pecl install –nodeps mcrypt-snapshot
- sudo bash -c “echo extension=mcrypt.so > /etc/php/7.2/cli/conf.d/mcrypt.ini”
- php7.2 -i | grep mcrypt
Well did manage to get the whole thing going.