How to Install and Configure phpMyAdmin in any Linux OS
In this article you will learn installing and running how to install and configure PhpMyAdmin in any Linux Operating System.
In this article, we will guide you by steps to so you need to follow these steps and using commands to Install PhpMyAdmin.
We will follow these Steps to Install and Run PhpMyAdmin in any Linux OS:
- Step 1: Update System Dependencies (like Ubuntu, RedHat, CentOS)
- Step 2: Add PHP PPA (supporting OS Ubuntu, RedHat, CentOS like OS)
- Step 3: Install PHP for Apache
- Step 4: Install PHP 8.X or higher version Extensions
- Step 5: Verifying PHP Version
- Step 6: Configure PHP
Step 1: Update System Dependencies
In this article we will update system dependencies in these type Linux OS (Ubuntu, RedHat, CentOS), So First we are going to update system dependencies using the following command at a command prompt to update the latest packages or dependencies.
sudo apt update
sudo apt upgrade
Step 2: Add PHP PPA
Adding PHP PPA on supporting OS such as (Ubuntu, RedHat, CentOS), using following command.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Step 3: Install PHP for Apache
In this step we will install PHP for apache by execute the following command on command prompt.
sudo apt install php
or
sudo apt install php8.1
To confirm the installation using the following command.
php -v
Step 4: Install PHP 8.x or higher version Extensions
We need to install PHP 8.x extensions using the following command.
sudo apt install php-extension_name
or
sudo apt install php8.1-extension_name
Now we will install some commonly used php-extensions with the following command.
sudo apt install php8.1-common php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-curl php8.1-gd php8.1-imagick php8.1-cli php8.1-dev php8.1-imap php8.1-mbstring php8.1-opcache php8.1-soap php8.1-zip php8.1-redis php8.1-intl -y
Step 5: Verifying PHP Version
In this step, we are going to verify php version using the following command.
php -v
Output will show like this:
PHP 8.1 (cli) (built: NOVEMBER 11 2022 11:33:10) (PMT)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
with Zend OPcache v8.1.5, Copyright (c), by Zend Technologies
Step 6: Configure PHP profile file
This is last where you will configure all files of php and phpmyadmin, you need to execute the following command to edit php.ini
sudo nano /etc/php/8.1/apache2/php.ini
or
sudo nano /etc/php/8/apache2/php.ini
Enter F6 for search inside the editor and update the following values for better performance.
upload_max_filesize = 32M
post_max_size = 48M
memory_limit = 256M
max_execution_time = 600
max_input_vars = 3000
max_input_time = 1000
Then execute the following command on command prompt to restart apache web server.
sudo service apache2 restart
Hope this will helpful for #webdevelopers.