To install the latest version of phpMyAdmin on Ubuntu, you can follow these steps:
1. Update the package list to ensure you have the latest information about available packages:
sudo apt update
2. Install phpMyAdmin:
sudo apt install phpmyadmin
During the installation, you will be prompted to choose a web server. Select either Apache or Nginx, depending on your preference. Use the arrow keys to navigate and press the Spacebar to select the desired server. Then press Enter.
You will also be asked if you want to configure the database for phpMyAdmin with dbconfig-common. Choose “Yes” and enter the MySQL root password when prompted.
Complete the installation by configuring your web server. If you chose Apache, you’ll need to enable the phpMyAdmin configuration by creating a symbolic link:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin
sudo service apache2 reload
For Nginx, you need to include the phpMyAdmin configuration in your Nginx server block:
sudo nano /etc/nginx/sites-available/default
Add the following line inside the server
block:
include /etc/nginx/phpmyadmin;
Save the file and reload Nginx:
sudo service nginx reload
Access phpMyAdmin in your web browser by visiting http://your-server-ip/phpmyadmin
or http://localhost/phpmyadmin
if you are installing it on the local machine.
Remember to replace “your-server-ip” with the actual IP address of your server.
That’s it! You have successfully installed phpMyAdmin on Ubuntu with either Apache or Nginx as the web server.