The phpMyAdmin is a free and open-source web application tool for managing the MySQL or MariaDB database. The phpMyAdmin is primarily written in PHP and allows you to manage your MySQL/MariaDB databases from the web browser. You can easily create, update, import, and export your MySQL/MariaDB databases from one place dashboard.

This tutorial will show you how to install and configure phpMyAdmin on the FEMP Stack FreeBSD 12.0. We will install some additional PHP extensions that needed, Install phpMyAdmin from the Ports repository, and Configure the Apache web server for phpMyAdmin.

Prerequisite

For this guide, we will use the FreeBSD 12.0 with 1GB of RAM 2 CPUs. And make sure the FAMP Stack is installed on top of it. You can use the link below to install the FAMP Stack on your FreeBSD 12.0.

Install FEMP Stack on FreeBSD 12.0

What we will do:

  • Install Additional PHP Extensions
  • Install and Configure phpMyAdmin
  • Configure Apache Web Server
  • Testing

Step 1 – Install PHP Extensions

Firstly, we need to install some of the PHP extensions needed for the phpMyAdmin installation.

Install some of the PHP extensions using the pkg command below.

pkg install php73-ctype php73-filter php73-mysqli php73-json php73-mbstring php73-session php73-hash php73-xml php73-openssl php73-bz2 php73-zip

Once all installations are complete, check PHP extensions loaded using the following command.

php -m | egrep "ctype|filter|mysqli|json|mbstring|session|hash|xml|openssl|zip"

Now you will get the result as below.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

And as a result, all PHP extensions that needed for phpMyAdmin installation has been installed to the FreeBSD 12.0 system. And we’re ready to install the phpMyAdmin package.

Step 2 – Install phpMyAdmin

By default, the FreeBSD provides the package for phpMyAdmin. So, we can install the phpMyAdmin package using the pkg package management tool.

List all phpMyAdmin package on the repository.

pkg search phpmyadmin

Now you will get multiple version of phpMyAdmin.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

Install the latest version of phpMyAdmin package using the pkg command below.

pkg install phpMyAdmin-php73

Once the installation is complete, you will get the result as below.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

Now you need to generate the blowfish secret password for phpMyAdmin, And you can use the online blowfish secret generator on the link below.

phpMyAdmin Blowfish Secret Generator

Copy the blowfish secret to your note.

Go to the phpMyAdmin installation directory and copy the sample configuration file to ‘config.inc.php’.

cd /usr/local/www/phpMyAdmin/
 cp config.sample.inc.php config.inc.php

Edit the phpMyAdmin configuration file ‘config.inc.php’ using vim editor.

vim config.inc.php

Paste the blowfish secret that we’ve generated to the following line.

$cfg['blowfish_secret'] = '/ES=Gla4KWBD}8nPplvHA]wxwPLYvFSI';

Save and close.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

Now the phpMyAdmin package has been installed on the FreeBSD 12.0 system.

Step 3 – Configure Apache Web Server

In this step, we will edit the Apache configuration and add the additional configuration for the phpMyAdmin.

Go to the apache configuration directory ‘/usr/local/etc/apache24/’ and edit the ‘httpd.conf’ file.

cd /usr/local/etc/apache24/
 vim httpd.conf

Paste the following configuration to the end of the line.

    Alias /phpmyadmin/ "https://vitux.com/usr/local/www/phpMyAdmin/"

Options None
AllowOverride Limit

Require all granted

Save and close.

Now the phpMyAdmin will be accessible on the URL path ‘http://IP-Address/phpmyadmin/‘.

Next, test the apache configuration and make sure there is no error. Then restart the Apache service.

apachectl configtest
 service apache24 restart

And the Apache configuration for phpMyAdmin has been completed.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

Step 4 – Testing

Open your web browser and type the server IP address with the phpMyAdmin path as below.

http://10.5.5.15/phpmyadmin/

Now you will get the phpMyAdmin login page as below.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

Type your MySQL/MariaDB user and password and click the ‘Go’ button.

And you will get the phpMyAdmin dashboard as below.

How to Install phpMyAdmin on FreeBSD 12.0 FreeBSD

As a result, you can manage the MySQL databases and users from the phpMyAdmin dashboard.

The installation and configuration of phpMyAdmin on FreeBSD 12.0 has been completed successfully.

Links