To install (Apache, PHP, MariaDB, PHPMyAdmin), please open your terminal and follow the below simple steps:
First, install apache2 package:sudo apt install apache2 Enable apache service
sudo systemctl stop apache2.service sudo systemctl start apache2.service sudo systemctl enable apache2.service Install mariadb server and client
sudo apt-get install mariadb-server mariadb-client Enable mariadb server
sudo systemctl stop mariadb.service sudo systemctl start mariadb.service sudo systemctl enable mariadb.service Setup mariadb server
sudo mysql_secure_installation Enter current password for root (enter for none): Just press the Enter Set root password? [Y/n]: Y New password: Enter a new password Re-enter new password: Repeat your password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y Install php7.4
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt install php7.4-fpm php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-soap php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-cli php7.4-zip php7.4-curl libapache2-mod-php7.4 check your php version
php -v Install phpmyadmin
sudo apt install phpmyadmin Select the apache2 server Configure database for phpmyadmin with dbconfig-common? Yes Now configure your phpmyadmin with mariadb sudo mysql -u root (if prompting for the password, use your new password) Flush the local user access use mysql; update user set plugin=” where User=’root’; flush privileges; exit; Restart mariadb server to make all the changes effective sudo systemctl restart mariadb.service Open your localhost (now you should see the apache2 default page) To access phpmyadmin, open
localhost/phpmyadmin
change root user password
UPDATE mysql.user SET Password = PASSWORD(‘YOURNEWPASSWORD’) WHERE User = ‘root’;
FLUSH PRIVILEGES;
exit;
Give full permission to files and folder
sudo chmod -R 777 /var/www/html
WordPress Install Error
Can’t install WordPress themes – FTP Error
define('FS_METHOD', 'direct'); //add it to the wp-config.php file
For folder create error -
sudo chmod -R 777 /var/www/html/wordpress