Menu

11/18/26

GUIDE TO INSTALLING PHPMYADMIN in LINUX webserver

STEP-BY-STEP GUIDE TO INSTALLING PHPMYADMIN



phpMyAdmin is a free, open-source, web-based database administration tool written in PHP.

In short, it provides a graphical user interface (GUI) right in your web browser to easily manage database systems like MySQL or MariaDB. Instead of manually typing SQL commands in a terminal, you can simply point and click to create, edit, or delete databases and tables, manage data, import/export .sql files, and configure user permissions quickly and intuitively.

Environment Overview

Operating System: Linux (e.g., Amazon Linux 2023 / CentOS / RHEL)

Server IP Address: 113.111.200.100

Active Web Root Directory: /var/www/html/myphpsourcecode/

 

Prerequisites

Before installing phpMyAdmin, ensure that your server has a working web server (Apache/Nginx), PHP, and a database server (MySQL/MariaDB) installed.

Installation Steps

Step 1: Install required PHP extensions

phpMyAdmin requires specific PHP extensions to function correctly. Install them and restart your web server:

sudo dnf install php-mbstring php-xml php-mysqlnd -y
sudo systemctl restart httpd

Step 2: Download and extract phpMyAdmin

Navigate to your home directory, download the latest version of phpMyAdmin, and extract it:

cd ~
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
tar -xvzf phpMyAdmin-latest-all-languages.tar.gz

Step 3: Move to the web root directory

Rename the extracted folder and move it to your active web root directory:

mv phpMyAdmin-*-all-languages phpmyadmin
sudo mv phpmyadmin /var/www/html/myphpsourcecode/

Step 4: Configure security settings

Create a configuration file from the sample provided and add a secret passphrase for cookie encryption:

cd /var/www/html/myphpsourcecode/phpmyadmin
sudo cp config.sample.inc.php config.inc.php
sudo nano config.inc.php

Inside the file, find the line:
$cfg['blowfish_secret'] = '';
Change it to include a random string (at least 32 characters), for example:
$cfg['blowfish_secret'] = 'your_random_secret_string_here_123456789';

Step 5: Set permissions

Ensure the web server (e.g., Apache) has ownership and appropriate permissions for the directory:

sudo chown -R apache:apache /var/www/html/myphpsourcecode/phpmyadmin
sudo chmod -R 755 /var/www/html/myphpsourcecode/phpmyadmin

Step 6: Clean up and Verify

Remove the downloaded archive file to save space:

rm ~/phpMyAdmin-latest-all-languages.tar.gz

Finally, open your web browser and navigate to:

http://113.111.200.100/phpmyadmin

You should now see the login screen. Log in using your MySQL/MariaDB database credentials.

No comments:

Post a Comment