In this tutorial, we are going to step by step how to Install the Latest phpMyAdmin on Ubuntu 20.04 Linux. You can choose your perfect Linux VPS Server Packages in Eldernode. Stay with us!
Table of Contents
Tutorial How to Configure and Install the Latest phpMyAdmin on Ubuntu 20.04 Linux
Step 1) How to Install Apache and PHP
First install the other necessary packages to run and access phpMyAdmin.
sudo apt install apache2 wget unzip sudo apt install php php-zip php-json php-mbstring php-mysql
After install complete, enable and start the Apache web server:
systemctl enable apache2 systemctl start apache2
Step 2) How to Install phpMyAdmin on Ubuntu 20
Install PHPMyAdmin using the following commands:
wget https://files.phpmyadmin.net/phpMyAdmin/5.0.2/phpMyAdmin-5.0.2-all-languages.zip unzip phpMyAdmin-5.0.2-all-languages.zip mv phpMyAdmin-5.0.2-all-languages /usr/share/phpmyadmin
Now, create a tmp directory and set the appropriate permissions:
mkdir /usr/share/phpmyadmin/tmp chown -R www-data:www-data /usr/share/phpmyadmin chmod 777 /usr/share/phpmyadmin/tmp
Step 3) How to Configure phpMyAdmin
Now, create the Apache configuration file for phpMyAdmin and edit it in the text editor:
nano /etc/apache/conf-enabled/phpmyadmin.conf
Now, add the following content to file:
Alias /phpmyadmin /usr/share/phpmyadmin Alias /phpMyAdmin /usr/share/phpmyadmin <Directory /usr/share/phpmyadmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> <RequireAny> Require all granted </RequireAny> </IfModule> </Directory> <Directory /usr/share/phpmyadmin/setup/> <IfModule mod_authz_core.c> <RequireAny> Require all granted </RequireAny> </IfModule> </Directory>
Save your file and close it.
then, run the command below:
sudo a2enconf phpmyadmin sudo systemctl restart apache2
Step 4) How to Adjusting FirewallD on Ubuntu
Run the following commands to open a port for the webserver on the firewall:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload
Step 5 – How to Access phpMyAdmin on browser
Installation completed. Now enter the IP address in the browser and see the PHPMyAdmin page
http://ip/phpmyadmin
Good luck.
I follow these steps and my webpage says access forbidden 403.
My normal site works fine but I can’t access phpmyadmin.
A 403 status code indicates that the client cannot access the requested resource. It means the wrong username and password were sent in the request, or that the permissions on the server do not allow what was being asked.