How To Install phpMyAdmin with Apache on CentOS 8

How To Install phpMyAdmin with Apache on CentOS 8

phpMyAdmin is a database management tool for MySQL compatible databases. The current version of phpMyAdmin, at the time of this recording, supports MySQL 5.5 or later. If you’re using MySQL 5.0-5.4, you need to use phpMyAdmin 4.0. The current version of phpMyAdmin also supports MariaDB 5.5 or later.

phpMyAdmin is one of the most popular applications for MySQL database management. It is a free tool written in PHP. Through this software, you can create, alter, drop, delete, import and export MySQL database tables.

Install phpMyAdmin with apache on centOS 8; Through this tutorial, we will learn how to install phpMyAdmin with apache on CentOS 8.

How To Install phpMyAdmin with Apache on CentOS 8

Follow the following steps to install phpMyAdmin with Apache on CentOS 8:

  • Step 1 – Install Required Packages
  • Step 2 – Install phpMyAdmin on CentOS
  • Step 3 – Configure phpMyAdmin
  • Step 4 – Adjust Firewall
  • Step 5 – Access phpMyAdmin

Step 1 – Install Required Packages

First of all, open terminal or command line and execute the following command into it to install required package in centOS system:

sudo dnf install httpd wget unzip
sudo dnf install php php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd

Once the installation is completed, execute the following command on command line or terminal to enable and start httpd web server:

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Step 2 – Install phpMyAdmin on CentOS

Execute the following command on command line or terminal to download and extract archive and move to the proper location:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip
unzip phpMyAdmin-5.0.1-all-languages.zip
mv phpMyAdmin-5.0.1-all-languages /usr/share/phpmyadmin

Then create tmp directory and set the proper permissions by executing the following command on command line or terminal:

mkdir /usr/share/phpmyadmin/tmp
chown -R apache:apache /usr/share/phpmyadmin
chmod 777 /usr/share/phpmyadmin/tmp

Step 3 – Configure phpMyAdmin

Execute the following command on command line or terminal to configure web server to serve phpMyAdmin on network. And create Apache configuration file for phpMyAdmin and edit in text editor:

vi /etc/httpd/conf.d/phpmyadmin.conf

Now, add the following content to file:

Alias /phpmyadmin /usr/share/phpmyadmin
 
<Directory /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
      Require all granted
     </RequireAny>
   </IfModule>
</Directory>
 
<Directory /usr/share/phpmyadmin/setup/>
   <IfModule mod_authz_core.c>
 # Apache 2.4
     <RequireAny>
       Require all granted
     </RequireAny>
   </IfModule>
</Directory>

Then save file and close it. The systems with SELinux enabled needs to set proper permissions to allow SELinux policies:

chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*

After completing all the changes, make sure to start the Apache service to reload all settings:

systemctl restart httpd.service

Step 4 – Adjust Firewall

Now, execute the following command on the command line or terminal to enable firewalls needs to allow HTTP service from the firewall:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Step 5 – Access phpMyAdmin

Finally, open the browser and hit the following URL with ip address to access phpMyAdmin:

http://your-server-ip/phpmyadmin

Conclusion

Through this tutorial, we have learned how to install phpMyAdmin with apache on CentOS 8.

Recommended CentOS Tutorials

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *