{"id":10238,"date":"2021-09-20T18:40:39","date_gmt":"2021-09-20T18:40:39","guid":{"rendered":"https:\/\/linuxways.net\/?p=10238"},"modified":"2021-09-23T08:41:04","modified_gmt":"2021-09-23T08:41:04","slug":"how-to-install-phpmyadmin-on-almalinux-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-install-phpmyadmin-on-almalinux-centos-8\/","title":{"rendered":"How to Install phpMyAdmin on AlmaLinux \/ CentOS 8"},"content":{"rendered":"<p>phpMyAdmin is an open-source, web-based administration tool written in PHP.<\/p>\n<p>It is a popular tool used for managing MySQL and MariaDB servers. It is used by system administrators for performing activities such as creating and managing databases, users, relations, permissions. It has a simple and user-friendly interface for performing database administration tasks.<\/p>\n<p>In this guide, we will go through the installation of phpMyAdmin on AlmaLinux<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>Before installing PHPMyAdmin, you need to have the following requisite packages installed.<\/p>\n<ul>\n<li>PHP<\/li>\n<li>Database Server(MySQL or MariaDB)<\/li>\n<li>Apache Web server.<\/li>\n<\/ul>\n<h2><strong>Step 1: Install additional PHP modules<\/strong><\/h2>\n<p>The Current version of PhpMyAdmin is compatible with PHP 7.1 and later versions as well as MySQL\/MariaDB 5.5 and newer versions. You need to install PHP as well as the MySQL support package for PHP, and other necessary PHP packages for phpMyAdmin to function as expected on your CentOS \/ AlmaLinux system.<\/p>\n<p>Therefore, run the following command to install the necessary php packages required to utilize PHP with Apache and MySQL:<\/p>\n<pre><strong>$ sudo dnf -y install php php-fpm php-mysqlnd php-opcache php-gd php-xml php-mbstring php-zip<\/strong><\/pre>\n<h2><strong> Step 2: Install phpMyAdmin<\/strong><\/h2>\n<p>Once the dependencies have been installed, our system is now ready for the phpMyAdmin installation. phpMyAdmin is not available in the system\u2019s default repositories, and so you need to download the latest version of the phpMyAdmin archive from the official site. At the time of writing this guide, the current version of phpMyAdmin is 5.1.1<\/p>\n<p>Run the following wget command to download phpMyAdmin zip file:<\/p>\n<pre><strong>$ wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/5.1.1\/phpMyAdmin-5.1.1-all-languages.zip<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1057\" height=\"169\" class=\"wp-image-10239\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-400.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-400.png 1057w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-400-300x48.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-400-1024x164.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-400-768x123.png 768w\" sizes=\"auto, (max-width: 1057px) 100vw, 1057px\" \/><\/strong><\/p>\n<p>After the download is complete, extract the packages as shown<strong>:<\/strong><\/p>\n<pre><strong>$ unzip phpMyAdmin-5.1.1-all-languages.zip<\/strong><\/pre>\n<p>Next, move phpMyAdmin to the <strong>usr\/share\/phpMyadmin<\/strong> directory.<\/p>\n<pre><strong>$ sudo mv phpMyAdmin-5.1.1-all-languages \/usr\/share\/phpMyAdmin<\/strong><\/pre>\n<p>Then, create a <em>tmp<\/em> directory . Run:<\/p>\n<pre><strong>$ sudo mkdir -p \/usr\/share\/phpMyAdmin\/tmp<\/strong><\/pre>\n<p>Set the necessary permissions with the commands:<\/p>\n<pre><strong>$ sudo chown -R apache:apache \/usr\/share\/phpMyAdmin<\/strong><\/pre>\n<pre><strong>$ sudo chmod 777 \/usr\/share\/phpMyAdmin\/tmp<\/strong><\/pre>\n<h2><strong><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"79\" class=\"wp-image-10240\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-401.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-401.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-401-300x32.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/strong><\/h2>\n<h2><strong> Step 3: Configure Apache web server for phpMyAdmin<\/strong><\/h2>\n<p>In this step, we will configure the web server to serve phpMyAdmin on the network. First, let\u2019s create an Apache configuration file for phpMyAdmin.<\/p>\n<pre><strong>$ sudo vi \/etc\/httpd\/conf.d\/phpmyadmin.conf<\/strong><\/pre>\n<p>Paste the lines below to the apache configuration file. Here, we also create an alias that we will use to access phpMyAdmin.<\/p>\n<pre><strong>Alias \/phpmyadmin \/usr\/share\/phpMyAdmin<\/strong><\/pre>\n<p>&nbsp;<\/p>\n<pre><strong>&lt;Directory \/usr\/share\/phpMyAdmin\/&gt;<\/strong>\r\n\r\n<strong> AddDefaultCharset UTF-8<\/strong>\r\n\r\n<strong> &lt;IfModule mod_authz_core.c&gt;<\/strong>\r\n\r\n<strong> # Apache 2.4<\/strong>\r\n\r\n<strong> &lt;RequireAny&gt;<\/strong>\r\n\r\n<strong> Require all granted<\/strong>\r\n\r\n<strong> &lt;\/RequireAny&gt;<\/strong>\r\n\r\n<strong> &lt;\/IfModule&gt;<\/strong>\r\n\r\n<strong>&lt;\/Directory&gt;<\/strong>\r\n\r\n\r\n\r\n\r\n<strong>&lt;Directory \/usr\/share\/phpMyAdmin\/setup\/&gt;<\/strong>\r\n\r\n<strong> &lt;IfModule mod_authz_core.c&gt;<\/strong>\r\n\r\n<strong># Apache 2.4<\/strong>\r\n\r\n<strong> &lt;RequireAny&gt;<\/strong>\r\n\r\n<strong> Require all granted<\/strong>\r\n\r\n<strong> &lt;\/RequireAny&gt;<\/strong>\r\n\r\n<strong> &lt;\/IfModule&gt;<\/strong>\r\n\r\n<strong>&lt;\/Directory&gt;<\/strong><\/pre>\n<p>Save and close the file.<\/p>\n<h2><strong>Step 4: Configure SELinux and Firewall<\/strong><\/h2>\n<p>For systems with SELinux enabled, run the following command to set correct permissions to allow SELinux policies.<\/p>\n<pre><strong>$ sudo chcon -Rv --type=httpd_sys_content_t \/usr\/share\/phpmyadmin\/*<\/strong><\/pre>\n<p>Finally, ensure to restart the Apache service for all the changes to take effect. Run:<\/p>\n<pre><strong>$ sudo systemctl restart httpd<\/strong><\/pre>\n<p>If you have enabled the firewall, you need to allow HTTP traffic. Run the following command to allow HTTP traffic:<\/p>\n<pre><strong>$ sudo firewall-cmd --permanent --add-service=http<\/strong><\/pre>\n<p>Next, reload the firewall after making these changes<\/p>\n<pre><strong>$ sudo firewall-cmd --reload<\/strong><\/pre>\n<p>Great! The only thing remaining is to access phpMyAdmin from a browser.<\/p>\n<pre><strong>Access phpMyAdmin<\/strong><\/pre>\n<p>Finally, let&#8217;s access the phpMyAdmin web portal. Open your web browser and access PHP my admin with the following address:<\/p>\n<pre><strong>$ <\/strong><a href=\"http:\/\/your-server-ip\/phpMyAdmin\"><strong>http:\/\/your-server-ip\/phpMyAdmin<\/strong><\/a><\/pre>\n<p>The browser will now display the phpMyAdmin login page.<\/p>\n<p>Login with your MariaDB root credentials:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"652\" class=\"wp-image-10241\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-402.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-402.png 876w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-402-300x223.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-402-768x572.png 768w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/p>\n<pre><strong>systemctl restart httpd.service<\/strong><\/pre>\n<p>You will be directed to the phpMyAdmin dashboard as provided.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1170\" height=\"779\" class=\"wp-image-10242\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-403.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-403.png 1170w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-403-300x200.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-403-1024x682.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/09\/word-image-403-768x511.png 768w\" sizes=\"auto, (max-width: 1170px) 100vw, 1170px\" \/><\/strong><\/p>\n<p>From here, you can create and manage all the databases conveniently without the need of running SQL queries.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>You have successfully completed the installation and configuration of phpMyAdmin on CentOS 8\/AlmaLinux 8.<\/p>","protected":false},"excerpt":{"rendered":"<p>phpMyAdmin is an open-source, web-based administration tool written in PHP. It is a popular tool used for managing MySQL and MariaDB servers. It is used by system administrators&hellip;<\/p>","protected":false},"author":1,"featured_media":10325,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[444,93,257],"class_list":["post-10238","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-almalinux","tag-centos-8","tag-phpmyadmin"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10238"}],"version-history":[{"count":2,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10238\/revisions"}],"predecessor-version":[{"id":10460,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10238\/revisions\/10460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/10325"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}