Setting up LAMP STACK on UBUNTU - Libbna/BLOG_SITE GitHub Wiki
STEPS FOR INSTALLING LINUX, APACHE, MYSQL, and PHP on ubuntu
Install APACHE
- sudo apt update
- sudo apt install apache2
- sudo a2enmod rewrite ----> enable clean urls by enabling apache rewrite.
To check if the apache is successfully installed or2 not, run http://localhost/
Install MYSQL
- sudo apt install mysql-server
- sudo mysql ---> This will connect to the MySQL server as the administrative database user root,
- To exit the MySQL console, type: exit
Install PHP
- sudo apt install php libapache2-mod-php php-mysql
- php -v ---> to check whether the php is installed or not.
Install phpMyAdmin
- sudo apt update
- sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
- php-mbstring: A module for managing non-ASCII strings with different encodings
- php-zip: An extension that facilitates uploading .zip files to phpMyAdmin
- php-gd: Enables support for GD graphics library
- php-json: Provides support for JSON serialization
- php-curl: Allows PHP to communicate with other servers
To use MySQL we need to enable password login in MySQL. enter the following command to launch the MySQL console:
-
sudo mysql
-
Now enter the following query to enable password authentication in MySQL
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'MyStrongPassword1234$';
_-> you can write your own password within single quotes ''._
-
Exit from the MySQL console by typing exit.
-
Now you can log in using your MySQL password by entering the following command to the MySQL console
sudo mysql -u root -p
Ref: https://www.codewithharry.com/blogpost/install-phpmyadmin-ubuntu https://www.youtube.com/watch?v=NboJeJTRzic&ab_channel=CodeWithHarry