How to install Linux Apache, MySQL with PHPMYADMIN, PHP (LAMP) on Ubuntu

How to install Linux Apache, MySQL with PHPMYADMIN, PHP (LAMP) on Ubuntu

LAMP is an open-source platform for web development. It uses LINUX as an operating system, Apache as web server, MySQL as a relational database management system and PHP as an object-oriented programing language.

Let’s start the installation of LAMP in the Linux 18.04 UBUNTU operating system.

step 1: Update your system.

sudo apt-get update

step 2: Install Tasksel

sudo apt-get -y install tasksel

step 3: Install LAMP server

sudo tasksel install lamp-server

#aptitude failed error?

sudo apt-get update
sudo apt-get upgrade

step 4: Install PHPMyAdmin

sudo apt-get install phpmyadmin

step 5: if mysql version >= 5.7 and mysql only work with ROOT user.

DROP USER 'root'@'localhost';
CREATE USER 'root'@'%' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

step 6: Now set group www-data to the html folder.

sudo chgrp www-data /var/www/html

step 7: Make it writable for the group

sudo chmod 775 /var/www/html

step 8: Set GID to www-data for all sub-folders

sudo chmod g+s /var/www/html

step 9: Add your username (username replace with your system username) to www-data group

sudo usermod -a -G www-data username

step 10: Finally change ownership to username

sudo chown username /var/www/html

step 11: Check your PHP version using.

php -v

step 12: Now install PHP modules.

apt-get install php-pear php7.3-curl php7.3-dev php7.3-gd php7.3-mbstring php7.3-zip php7.3-mysql php7.3-xml

step 13: Now restart apache server

sudo service apache2 restart

I hope you like this article. Keep visiting my website for more upcoming articles. If you need any help with LAMP installation on UBUNTU or CENT OS you can contact me. You can ask me questions in comments also. You can connect me on social media as well links are below in the footer section. Keep connected. Happy Coding.

Prashant Sutharhttps://prashantsuthar.com
My self Prashant Suthar, I had experience worked with NodeJS, Core PHP, WordPress, CodeIgniter, Shopify, Prestashop, Opencart and many frameworks. I had some basic knowledge about server setup and maintenance. I also worked with third parties APIs like Twillio audio,video, SMS API, FB messenger API and many more. I am working as team lead & sr. developer in Ahmedabad, GJ, IN.

Comments

Similar Articles