{"id":9179,"date":"2021-06-19T09:48:44","date_gmt":"2021-06-19T06:48:44","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9179"},"modified":"2024-03-18T20:54:45","modified_gmt":"2024-03-18T17:54:45","slug":"install-phpmyadmin-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-phpmyadmin-on-rocky-linux-8\/","title":{"rendered":"Install phpMyAdmin on Rocky Linux 8"},"content":{"rendered":"\n
Follow through this tutorial to learn how to install phpMyAdmin on Rocky Linux 8. phpMyAdmin<\/a> is a free and opensource application written in PHP that facilitates the administration and management of MySQL and MariaDB over the Web.<\/p>\n\n\n\n phpMyAdmin allows administrators to;<\/p>\n\n\n\n Note<\/strong>: In this guide, we are going to install phpMyAdmin v5.1.1,<\/strong> which the current stable release version as of this writing. This version supports PHP 7.1.3 and MySQL 5.5 or newer<\/strong>. Note this while installing your LAMP\/LEMP stack. You can check more requirements including the required PHP modules on PHP requirements page<\/a>.<\/p><\/p>\n\n\n\n Update your system packages.<\/p>\n\n\n\n Install LEMP\/LAMP Stack on Rocky Linux 8 by following the links provided below;<\/p>\n\n\n\n Install LAMP Stack on Rocky Linux 8<\/a><\/p>\n\n\n\n Install LEMP Stack on Rocky Linux 8<\/a><\/p>\n\n\n\n In this guide, PHP 7.4, MariaDB 10.5<\/strong> and Nginx<\/strong> are used.<\/p>\n\n\n\n If not already installed, run the command below to install other required PHP extensions for phpMyAdmin.<\/p>\n\n\n\n Once you have setup your LAMP\/LEMP stack, databases, your WordPress or whatever your web application is, proceed to install phpMyAdmin.<\/p>\n\n\n\n As of this writing, phpMyAdmin is not available on the default Rocky Linux 8 repos.<\/p>\n\n\n\n Therefore, to install phpMyAdmin, download the latest source tarball from\u00a0phpMyAdmin downloads page<\/a>.<\/p>\n\n\n\n You can download phpMyAdmin kits for English or All languages. This guide is using phpMyAdmin English version only. Make the download easy by using wget command.<\/p>\n\n\n\n To download the latest stable release version, check the versions on the downloads page and simply create a variable to hold the latest version number.<\/p>\n\n\n\n Well, you can as well download phpMyAdmin that supports all the languages to enable you run a version of phpMyAdmin with language of your preference;<\/p>\n\n\n\n To ensure that you are installing a genuine version of phpMyAdmin, you need to verify the integrity of the downloaded archive.<\/p>\n\n\n\n Download and import phpMyAdmin PGP fingerprint key from the key servers.<\/p>\n\n\n\n Download the PGP signature for your specific version of phpMyAdmin from phpMyAdmin downloads page<\/a>.<\/p>\n\n\n\n Run the signature verification.<\/p>\n\n\n\n Keyword in the output; Good signature<\/strong>.<\/p>\n\n\n\n You can as well verify the checksum of the downloaded archive. Download the SHA256 hash for Calculate the SHA256 hash for downloaded file.<\/p>\n\n\n\n Compare the calculated hash with the downloaded hash.<\/p>\n\n\n\n If all is well, you are good to proceed.<\/p>\n\n\n\n Since phpMyAdmin comes as a standalone application ready for installation, simply extract it to your Web root directory. In this guide, we are using Nginx as the web server.<\/p>\n\n\n\n Create your phpMyAdmin web root directory. <\/p>\n\n\n\n Note that we are using Nginx web server in this setup. Replace the document root folder as per your web server type.<\/p>\n\n\n\n You can choose to use a different directory instead of the one created below;<\/p>\n\n\n\n Next, extract the phpMyAdmin to the directory created above.<\/p>\n\n\n\n You can now create a basic Nginx Server block for phpMyAdmin as shown below. Be sure to replace the directories accordingly.<\/p>\n\n\n\n Save the configuration file and run Nginx syntax verification.<\/p>\n\n\n\n Restart Nginx<\/p>\n\n\n\n Rename the sample phpMyAdmin configuration file;<\/p>\n\n\n\n Create a blowfish secret required for cookie based authentication to encrypt password in cookie. You can generate the blowfish secret online<\/a> and paste as follows;<\/p>\n\n\n\n Restart Nginx and PHP-FPM for the changes to take effect.<\/p>\n\n\n\n You can now access your phpMyAdmin from the browser by navigating to browser and using the the address, Login as database administrative user.<\/p>\n\n\n\n If you get the error:<\/p>\n\n\n\n It is because, you havent enabled MySQL Native password authentication. See how to on the link below;<\/p>\n\n\n\n Set Native Password Authentication Method as Default on MariaDB\/MySQL<\/a><\/p>\n\n\n\n Upon successful authentication, you will land on the phpMyAdmin dashboard.<\/p>\n\n\n\n There you go. You have successfully setup phpMyAdmin. You can now proceed to manage your databases using phpMyAdmin.<\/p>\n\n\n\n That marks the end of our guide on how to install phpMyAdmin.<\/p>\n\n\n\n Read more on phpMyAdmin user guide<\/a>.<\/p>\n\n\n\n Other Tutorials<\/p>\n\n\n\n Install phpMyAdmin on Ubuntu 20.04<\/a><\/p>\n\n\n\n\n
connecting required tables;<\/li>\n\n\n\n
functions, such as displaying BLOB-data as image or download-link;<\/li>\n\n\n\nInstalling phpMyAdmin on Rocky Linux 8<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
dnf update<\/code><\/pre>\n\n\n\n
php -v<\/code><\/pre>\n\n\n\n
PHP 7.4.20 (cli) (built: Jun 1 2021 15:41:56) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n with Zend OPcache v7.4.20, Copyright (c), by Zend Technologies<\/code><\/pre>\n\n\n\n
mysql -V<\/code><\/pre>\n\n\n\n
mysql Ver 15.1 Distrib 10.5.10-MariaDB, for Linux (x86_64) using readline 5.1<\/code><\/pre>\n\n\n\n
systemctl status nginx<\/code><\/pre>\n\n\n\n
\u25cf nginx.service - The nginx HTTP and reverse proxy server\n Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; disabled; vendor preset: disabled)\n Drop-In: \/usr\/lib\/systemd\/system\/nginx.service.d\n \u2514\u2500php-fpm.conf\n Active: active (running) since Sat 2021-06-19 00:13:03 EAT; 8s ago\n Process: 51988 ExecStart=\/usr\/sbin\/nginx (code=exited, status=0\/SUCCESS)\n Process: 51987 ExecStartPre=\/usr\/sbin\/nginx -t (code=exited, status=0\/SUCCESS)\n Process: 51985 ExecStartPre=\/usr\/bin\/rm -f \/run\/nginx.pid (code=exited, status=0\/SUCCESS)\n Main PID: 51990 (nginx)\n Tasks: 2 (limit: 11391)\n Memory: 4.0M\n CGroup: \/system.slice\/nginx.service\n \u251c\u250051990 nginx: master process \/usr\/sbin\/nginx\n \u2514\u250051991 nginx: worker process\n\nJun 19 00:13:03 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...\nJun 19 00:13:03 localhost.localdomain nginx[51987]: nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nJun 19 00:13:03 localhost.localdomain nginx[51987]: nginx: configuration file \/etc\/nginx\/nginx.conf test is successful\nJun 19 00:13:03 localhost.localdomain systemd[1]: nginx.service: Failed to parse PID from file \/run\/nginx.pid: Invalid argument\nJun 19 00:13:03 localhost.localdomain systemd[1]: Started The nginx HTTP and reverse proxy server.\n<\/code><\/pre>\n\n\n\n
Install Required PHP Modules on Rocky Linux 8<\/h3>\n\n\n\n
dnf install php-{spl,hash,ctype,json,mbstring,zip,gd,curl,xml,common}<\/code><\/pre>\n\n\n\n
Install phpMyAdmin<\/h3>\n\n\n\n
dnf whatprovides phpmyadmin<\/code><\/pre>\n\n\n\n
Error: No Matches found<\/code><\/pre>\n\n\n\n
Download phpMyAdmin<\/h4>\n\n\n\n
VER=5.1.1<\/code><\/pre>\n\n\n\n
wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER<\/strong>\/phpMyAdmin-$VER<\/strong>-english.tar.gz<\/code><\/pre>\n\n\n\n
https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER<\/strong>\/phpMyAdmin-$VER<\/strong>-all-languages.tar.gz<\/code><\/pre>\n\n\n\n
Verify phpMyAdmin Tarball Integrity<\/h4>\n\n\n\n
gpg --keyserver hkp:\/\/pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92<\/code><\/pre>\n\n\n\n
wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER\/phpMyAdmin-$VER-english.tar.gz.asc<\/code><\/pre>\n\n\n\n
gpg --verify phpMyAdmin-$VER-english.tar.gz.asc<\/code><\/pre>\n\n\n\n
\ngpg: assuming signed data in 'phpMyAdmin-5.1.1-english.tar.gz'\ngpg: Signature made Fri 04 Jun 2021 07:26:25 AM EAT\ngpg: using RSA key 3D06A59ECE730EB71B511C17CE752F178259BD92\ngpg: Good signature from \"Isaac Bennetch
phpMyAdmin-$VER-english.tar.gz<\/code><\/strong>.<\/p>\n\n\n\n
wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER<\/strong>\/phpMyAdmin-$VER-english.tar.gz.sha256<\/code><\/pre>\n\n\n\n
sha256sum phpMyAdmin-$VER-english.tar.gz<\/code><\/pre>\n\n\n\n
f01e0095661dbc45f6f136e35efe55823f8a9715a25afce71fa94f3bb93bcc29 phpMyAdmin-5.1.1-english.tar.gz<\/code><\/pre>\n\n\n\n
cat phpMyAdmin-$VER-english.tar.gz.sha256<\/code><\/pre>\n\n\n\n
f01e0095661dbc45f6f136e35efe55823f8a9715a25afce71fa94f3bb93bcc29 phpMyAdmin-5.1.1-english.tar.gz<\/code><\/pre>\n\n\n\n
Install phpMyAdmin<\/h3>\n\n\n\n
Extract phpMyAdmin Tarball<\/h4>\n\n\n\n
mkdir \/usr\/share\/nginx\/phpmyadmin<\/code><\/pre>\n\n\n\n
tar xzf phpMyAdmin-$VER-english.tar.gz -C \/usr\/share\/nginx\/phpmyadmin --strip-components=1<\/code><\/pre>\n\n\n\n
Create phpMyAdmin Nginx Server Block<\/h4>\n\n\n\n
\ncat > \/etc\/nginx\/conf.d\/phpmyadmin.conf << 'EOL'\nserver {\n listen 80;\n server_name pma.kifarunix-demo.com;\n root \/usr\/share\/nginx\/phpmyadmin;\n \n access_log \/var\/log\/nginx\/pma.kifarunix-demo.com_access.log;\n error_log \/var\/log\/nginx\/pma.kifarunix-demo.com_error.log;\n\n index index.php;\n\n location \/ {\n try_files $uri $uri\/ \/index.php?$args;\n }\n location ~ \\.php$ {\n try_files $uri =404;\n fastcgi_intercept_errors on;\n include fastcgi_params;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n fastcgi_pass unix:\/run\/php-fpm\/www.sock;\n }\n}\nEOL\n<\/code><\/pre>\n\n\n\n
nginx -t<\/code><\/pre>\n\n\n\n
nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful<\/code><\/pre>\n\n\n\n
systemctl restart nginx<\/code><\/pre>\n\n\n\n
Configure phpMyAdmin<\/h3>\n\n\n\n
cp \/usr\/share\/nginx\/phpmyadmin\/config{.sample,}.inc.php<\/code><\/pre>\n\n\n\n
vi \/usr\/share\/nginx\/phpmyadmin\/config.inc.php<\/code><\/pre>\n\n\n\n
\/** $cfg['blowfish_secret'] = ''; \/* YOU MUST FILL IN THIS FOR COOKIE AUTH! *\/\n$cfg['blowfish_secret'] = '{yqiCcF\/-1G8WE9LE,dD{3mQDBnv[]bN';<\/strong><\/code><\/pre>\n\n\n\n
systemctl restart nginx php-fpm<\/code><\/pre>\n\n\n\n
Accessing phpMyAdmin<\/h3>\n\n\n\n
http:\/\/server-host-name<\/strong><\/code>.<\/p>\n\n\n\n
<\/figure>\n\n\n\n
mysqli::real_connect(): (HY000\/1698): Access denied for user 'root'@'localhost'<\/code><\/pre>\n\n\n\n
<\/figure>\n\n\n\n