Install PhpMyAdmin Ubuntu 18.04 Nginx
What is PhpMyAdmin?
PhpMyAdmin is an open source software written in PHP that provides a graphical web-based interface for accessing and managing your MySQL or MariaDB databases running on the Ubuntu server. It is an ideal tool for managing databases on the go, as it is both powerful and easy to use. With a few clicks, users can easily create, edit, and delete databases and tables.
PhpMyAdmin supports a wide range of operations including data manipulation (insert, update, delete, order by), data import and export, administration of database users and their privileges, database backups, and a wide range of other operations.
The stable latest version of phpMyAdmin at the time of writing this article is 4.9.4. In this article, we will demonstrate how to install phpMyAdmin on an Ubuntu 18.04 server running the Nginx web server.
Prerequisites for Installing PhpMyAdmin on Ubuntu 18.04
Before you start with the tutorial, make sure you have the following requirements:
Step 1: Installing the Dependencies
The first step is to install the dependencies required for phpMyAdmin, including php5.6-mbstring. To do this, run the following command:
sudo apt-get update
sudo apt-get install php5.6-mbstring php-gettext
The commands will update the package lists and then install the packages, respectively.
Step 2: Installing phpMyAdmin
In order to install phpMyAdmin, first you need to download the latest stable version of it. To do this, run the following command:
wget https://files.phpmyadmin.net/phpMyAdmin/4.9.4/phpMyAdmin-4.9.4-english.tar.gz
Once the download is complete, extract it using the following command:
tar -xvzf phpMyAdmin-4.9.4-english.tar.gz
This will extract it into the phpMyAdmin directory. Now, you need to move this folder into the root web directory. To do so, run the following command:
sudo mv phpMyAdmin-4.9.4-english /usr/share/nginx/html/phpmyadmin
Once the folder has been moved, you need to give it the correct permissions so that the web server can access it:
sudo chown -R www-data:www-data /usr/share/nginx/html/phpmyadmin
Now, you can open phpMyAdmin in your browser. For this, go to http://server_IP_address/phpmyadmin in your browser, and you will be redirected to the phpMyAdmin login page.
Step 3: Configuring Nginx
Now, you need to configure the Nginx web server so that it can properly serve the phpMyAdmin files. To do this, you will have to create a new Nginx server block configuration file for phpMyAdmin:
sudo nano /etc/nginx/sites-available/phpmyadmin.conf
Add the following lines inside the file:
server {
listen 80;
server_name server_IP_address;
location / {
root /usr/share/nginx/html/phpmyadmin;
index index.php index.html index.htm;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Save and close the file, then enable the phpMyAdmin server block with the following command:
sudo ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/
Test the Nginx configuration and then restart Nginx for the changes to take effect:
sudo nginx -t
sudo systemctl restart nginx
Step 4: Configuring phpMyAdmin
Now, you need to configure phpMyAdmin to use the MySQL credentials for logging in. To do this, you need to copy the sample phpMyAdmin configuration file:
sudo cp /usr/share/nginx/html/phpmyadmin/config.sample.inc.php /usr/share/nginx/html/phpmyadmin/config.inc.php
Once the file has been copied, edit it:
sudo nano /usr/share/nginx/html/phpmyadmin/config.inc.php
At the bottom of the file, you need to add a line that defines the MySQL login credentials as follows:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'username_password';
Save and close the file. Now, you can access phpMyAdmin in your web browser, and login using the credentials you just defined.
Conclusion
In this article, we have demonstrated how to install phpMyAdmin on an Ubuntu 18.04 server running the Nginx web server. We hope you have found this tutorial helpful. Thank you for reading.
Thank you for reading this article. We hope you found this article to be helpful. Feel free to check out other articles on our website to learn more about web hosting and server management.
Related Posts:
- Error Nginx When Installing Certbot Ubuntu Error Nginx When Installing Certbot Ubuntu What is Nginx? Nginx is a web server software often used to serve web pages. It is known as a high-performance web server and…
- Install Laravel 5.1 Ubuntu 16.04 Nginx Install Laravel 5.1 on Ubuntu 16.04 Nginx Introduction Laravel is a free, open-source PHP web application framework that is highly popular with modern web developers. It leverages an expressive and…
- Install Nginx Phpmyadmin Centos 7 Install Nginx Phpmyadmin Centos 7 What is Nginx? Nginx is a web server that is used in Linux-based operating systems such as Centos 7. It is designed to handle high-traffic…
- Install Nginx Php Mysql Windows Server Install Nginx Php Mysql Windows Server Install Nginx Php Mysql Windows Server Installing Nginx Nginx is a web server that can be used to serve dynamic web pages as well…
- Wordpress Mariadb Nginx On Centos 7 Wordpress Mariadb Nginx On Centos 7 Installing Apache Apache is the most popular web server in the world. It is a powerful, versatile, and free open source software available for…
- Install Phpmyadmin Nginx Ubuntu 16.04 Php 7 Install Phpmyadmin Nginx Ubuntu 16.04 Php 7 Introduction to PhpMyAdmin PhpMyAdmin is a web-based tool that enables the users to manage their MySQL databases. It also provides a graphical interface…
- Strategies for Saving Storage Space on Your Lenovo A6 Note… Smartphones are becoming increasingly powerful and capable of performing more and more tasks. However, with all of this power comes the challenge of managing storage space. If you have a…
- How To Ubuntu 16.04 Multiple Php Nginx How to Ubuntu 16.04 Multiple PHP Nginx Ubuntu 16.04 is a robust operating system that is commonly used for web application development. This operating system uses Nginx as the web…
- Vps Webserver Nginx Php7 Mysql Vps Webserver Nginx Php7 Mysql What Is VPS Webserver? A VPS webserver is a Virtual Private Server (VPS) that has been configured to act as a web server. A VPS…
- Install Mariadb Nginx Debian 9.7 Install Mariadb and Nginx on Debian 9.7 Overview of Installing MariaDB and Nginx on Debian 9.7 Installing MariaDB and Nginx on Debian 9.7 can be an essential step when setting…
- Nginx Grant Access To Port Nginx Grant Access To Port Introduction Nginx is an open source web server that is incredibly popular, fast, and easy to use. It is used for hosting websites and applications,…
- How To Install Phpmyadmin On Nginx How To Install Phpmyadmin On Nginx Introduction PhpMyAdmin is an open source software program which is used to manage MySQL and MariaDB databases. It provides a graphical interface to execute…
- Ubuntu Server Postgresql Nginx Php Ubuntu Server Postgresql Nginx Php Introduction Optimizing your server is one of the most important steps you can take when it comes to running a successful website or application. It…
- Error 404 Because Server Nginx 1.14.0 Ubuntu… Error 404 Because Server Nginx 1.14.0 Ubuntu Transfer-Encoding Chunked Introduction to Error 404 Error 404 is a response code indicating that a page or file you have requested cannot be…
- Deploy Laravel Nginx Ubuntu 18 Deploy Laravel Nginx Ubuntu 18 Intro to Laravel Laravel is a free, open-source, Model-View-Controller (MVC) web framework written in PHP. It has become one of the most popular web development…
- Install Nginx Ubuntu 18.08 Local Install Nginx on Ubuntu 18.04 Local Installing Nginx on Ubuntu 18.04 can be accomplished quickly and in several different ways. Depending on your needs, some methods may be better suited…
- Install Odoo 11 Nginx Ubuntu 16 Install Odoo 11 Nginx Ubuntu 16 What is Odoo 11 Nginx? Odoo 11 Nginx is an open source software package designed to facilitate secure and reliable web development. It is…
- Install Phpmyadmin For Nginx Debian 8 Install Phpmyadmin For Nginx Debian 8 Introduction The Nginx web server popularly known as Nginx is a lightweight web server written in C programming language. It is an open source…
- Instal Nginx Ubuntu 18.04 Installing Nginx on Ubuntu 18.04 What is Nginx? Nginx is a lightweight, open source, high-performance web server designed for serving dynamic and static web content. It is capable of handling…
- Upgrade Nginx Ubuntu 18.04 Upgrade Nginx Ubuntu 18.04 Getting Started with Nginx Ubuntu 18.04 Installation Nginx is a high performance web server and reverse proxy. It is written in C and has ways to…
- Etc Nginx Sites-Available Default Permission Denied Etc Nginx Sites-Available Default Permission Denied What is Nginx and Why is it Used? Nginx is a powerful and open-source web server software used to host modern web applications. It…
- Kubectl Install Nginx Wordpress Bare Metal Kubectl Install Nginx Wordpress On Bare Metal Introduction To The Process Of Installing Nginx On Bare Metal With the new trend of cloud and automated solutions, it has become easier…
- Nginx Install Custom Directory Phpmyadmin Nginx Install Custom Directory PhpMyAdmin Introduction to Nginx and PhpMyAdmin Nginx is a web server and content caching solution used to host a variety of web applications. It is highly…
- Apt-Get Install Nginx Php Mysql Apt-Get Install Nginx Php Mysql What is Apt-Get? Apt-Get is a powerful and innovative command line tool used by Linux-based operating systems such as Debian, Ubuntu, Linux Mint and others.…
- Nginx Ssl Configuration Ubuntu 18.04 Nginx Ssl Configuration Ubuntu 18.04 What is Nginx? Nginx is an open source web server and reverse proxy software. It is used to manage web traffic on the internet, like…
- Wordpress Nginx Ubuntu 18.04 Wordpress Nginx Ubuntu 18.04 Overview WordPress is a popular web software used by millions of people around the world. It allows users to easily create and manage websites without the…
- Install Database Mysql Vagrant Nginx Install Database Mysql Vagrant Nginx What is Nginx? Nginx is an open source, high-performance web and proxy server designed to serve a variety of web applications. It handles requests from…
- Install Phpvirtualbox On Ubuntu 12.04 Nginx Install PHPVirtualbox on Ubuntu 12.04 Nginx What is PHPVirtualbox? PHPVirtualbox is a web-based management tool designed to assist the user in creating and managing virtualized environments. It is developed, maintained…
- Nginx Install Ssl Certificate Ubuntu Nginx Install SSL Certificate Ubuntu What is Nginx? Nginx is a free, open-source web server that is used for powering websites. It is popular for its speed, scalability, and stability,…
- Nginx Program Delete Cant Running With Extension Nginx Program Delete Cant Running With Extension What is Nginx? Nginx is an open-source, powerful web server that is designed to serve static content quickly and efficiently. It is well…