{"id":1821,"date":"2018-12-28T12:48:00","date_gmt":"2018-12-28T09:48:00","guid":{"rendered":"http:\/\/kifarunix.com\/?p=1821"},"modified":"2024-03-11T21:41:36","modified_gmt":"2024-03-11T18:41:36","slug":"how-to-install-phpmyadmin-on-freebsd-12","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-phpmyadmin-on-freebsd-12\/","title":{"rendered":"How to Install phpMyAdmin on FreeBSD 12"},"content":{"rendered":"\n
\"\"<\/figure>\n\n\n\n

This guides presents a simple way on how to install phpMyAdmin on FreeBSD 12. phpMyAdmin is a free and opensource tool written in PHP for managing MySQL and MariaDB tasks such as creating, altering, dropping, deleting database tables or running any other database management commands over the web interface.<\/p>\n\n\n\n

phpMyAdmin comes bundled with a handful features which you can check them from here<\/a>.<\/p>\n\n\n\n

Installing phpMyAdmin on FreeBSD 12<\/h2>\n\n\n\n

Prerequisites<\/h3>\n\n\n\n

Install FEMB\/FAMB Stack<\/h4>\n\n\n\n

In order to use phpMyAdmin, you need to have a FAMB or FEMB Stack installed on your FreeBSD 12 server.<\/p>\n\n\n\n

Install FEMP Stack on FreeBSD 12<\/a><\/p>\n\n\n\n

Install FAMB Stack on FreeBSD 12<\/a><\/p>\n\n\n\n

Install Required PHP Modules<\/h4>\n\n\n\n

Install the required PHP extensions if you have not done so already;<\/p>\n\n\n\n

pkg install php82-session php82-mbstring php82-mysqli wget curl php82-filter<\/pre>\n\n\n\n

You can verify the presence of the above PHP extensions by running the command below;<\/p>\n\n\n\n

php -m | egrep \"json|mbstring|session|mysqli|hash|filter\"<\/pre>\n\n\n\n
hash\njson\nmbstring\nmysqli\nsession\nfilter<\/code><\/pre>\n\n\n\n

If not enabled by default, edit the \/usr\/local\/etc\/php.ini<\/code> and add the following lines to load the extensions installed above.<\/p>\n\n\n\n

vi \/usr\/local\/etc\/php.ini<\/pre>\n\n\n\n
extension=mysqli.so\nextension=mbstring.so\nextension=json.so\nextension=session.so\nextension=filter.so<\/pre>\n\n\n\n

Save and quit the file.<\/p>\n\n\n\n

Restart Apache and confirm again using php -m<\/code><\/strong> command.<\/p>\n\n\n\n

service apache24 restart<\/code><\/pre>\n\n\n\n

Assuming you have FAMB\/FEMB Stack with the necessary PHP extensions up and running, proceed as follows;<\/p>\n\n\n\n

Note, we are using FAMB in this guide.<\/p>\n\n\n\n

Download phpMyAdmin package<\/h3>\n\n\n\n

In order to get the latest version of phpMyAdmin running on your server, navigate to the download page<\/a> and grab the latest package of phpMyAdmin. Even though phpMyAdmin is usually included in most systems default repositories, they may not be up-to-date. You can however check the same to verify.<\/p>\n\n\n\n

To install phpMyAdmin from the source, you can simply run the command below to download the current release version 5.2.1.<\/p>\n\n\n\n

Replace the value of the VER variable below with the current release version of phpMyAdmin;<\/p>\n\n\n\n

set VER=5.2.1<\/code><\/pre>\n\n\n\n
wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER\/phpMyAdmin-$VER-english.zip<\/pre>\n\n\n\n

Verify Integrity of phpMyAdmin Package<\/h4>\n\n\n\n

Verify that the downloaded file is not corrupted by comparing that SHA256 hash for the two files matches.<\/p>\n\n\n\n

From the phpMyAdmin download page, download the SHA256 file for the phpMyAdmin-$VER-english.zip<\/code> into the same directory where phpMyAdmin package is;<\/p>\n\n\n\n

wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER\/phpMyAdmin-$VER-english.zip.sha256<\/code><\/pre>\n\n\n\n

To check the SHA256 for the downloaded file, run the command below;<\/p>\n\n\n\n

sha256sum -c phpMyAdmin-$VER-english.zip.sha256<\/pre>\n\n\n\n

Output;<\/p>\n\n\n\n

phpMyAdmin-5.2.1-english.zip: OK<\/code><\/pre>\n\n\n\n

Great, the hashes match and we are good to proceed.<\/p>\n\n\n\n

The output will indicate whether the hash values match or not. If the hash values match, you will see a message indicating that the file is OK. If the hash values do not match, you will see an error message indicating that the file has failed the integrity check.<\/p>\n\n\n\n

Install phpMyAdmin on FreeBSD 12<\/h3>\n\n\n\n

Unzip the phpMyAdmin package downloaded above and move it to Apache Web Root directory, \/usr\/local\/www\/apache24\/data<\/code>.<\/p>\n\n\n\n

unzip phpMyAdmin-$VER-english.zip<\/pre>\n\n\n\n
mv phpMyAdmin-$VER-english \/usr\/local\/www\/apache24\/data\/phpmyadmin<\/pre>\n\n\n\n

CONFIGURE PHPMYADMIN<\/h3>\n\n\n\n

phpMyAdmin has been installed and thus can be configured as follows;<\/p>\n\n\n\n

Navigate to the \/usr\/local\/www\/apache24\/data\/phpmyadmin<\/code> and rename the PHP configuration file.<\/p>\n\n\n\n

cd \/usr\/local\/www\/apache24\/data\/phpmyadmin<\/pre>\n\n\n\n
cp config{.sample,}.inc.php<\/pre>\n\n\n\n

Create a tmp<\/code> folder for caching templates and set proper permissions;<\/p>\n\n\n\n

mkdir \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/pre>\n\n\n\n
chmod 755 \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/pre>\n\n\n\n
chown -R www:www \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/code><\/pre>\n\n\n\n

Create a blowfish secret required for cookie based authentication to encrypt password in cookie. The secret needs to be a 32-bytes long string of random bytes.<\/p>\n\n\n\n

You can generate the secret;<\/p>\n\n\n\n

openssl rand -hex 16<\/code><\/pre>\n\n\n\n
8e41a8be54813c6b8f34b0fe6ebb5edb<\/code><\/pre>\n\n\n\n

and paste as follows;<\/p>\n\n\n\n

vi \/usr\/local\/www\/apache24\/data\/phpmyadmin\/config.inc.php<\/pre>\n\n\n\n
...\n<\/strong>\/**\n * This is needed for cookie based authentication to encrypt password in\n * cookie. Needs to be 32 chars long.\n *\/\n$cfg['blowfish_secret'] = '8e41a8be54813c6b8f34b0fe6ebb5edb'; \/* YOU MUST FILL IN THIS FOR COOKIE AUTH! *\/\n\n\/**\n...<\/strong><\/pre>\n\n\n\n

Save and Exit the file<\/p>\n\n\n\n

Restart Apache for the changes to take effect.<\/p>\n\n\n\n

service apache24 restart<\/pre>\n\n\n\n

Access phpMyAdmin Web Interface<\/h3>\n\n\n\n

To access phpMyAdmin dashboard, navigate to the browser and enter the URL in the format, http:\/\/server-IP\/phpmyadmin<\/code>. This will take you to phpMyAdmin login page.<\/p>\n\n\n\n

\"Install<\/figure>\n\n\n\n

Login with MySQL database root credentials.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Running Database Queries on phpMyAdmin<\/h3>\n\n\n\n

You can see a list of databases on the left side of the phpMyAdmin Dashboard;<\/p>\n\n\n\n

Select a database and you will see a list of all the tables it has. Take for example default mysql database.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

To run Queries against database tables, click SQL tab at the top and enter your queries on the SQL query interface.<\/p>\n\n\n\n

For example;<\/p>\n\n\n\n

SELECT User, Host, Plugin FROM user WHERE User = 'root';<\/code><\/pre>\n\n\n\n

Once you have the query, click on the “Go” button to execute the query.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

After execution, the results of your query will be displayed below the SQL query box.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

You can continue executing more queries by writing them in the SQL query box and clicking “Go” each time.<\/p>\n\n\n\n

Other Tutorials<\/h2>\n\n\n\n

You can also check our previous articles on LAMP\/LEMP Stack using the following links;<\/p>\n\n\n\n

How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n

How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n

How to Install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29<\/a><\/p>\n\n\n\n

How To Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

This guides presents a simple way on how to install phpMyAdmin on FreeBSD 12. phpMyAdmin is a free and opensource tool written in PHP for<\/p>\n","protected":false},"author":1,"featured_media":16960,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,280,121,938],"tags":[278,6827,6826,6825,281],"class_list":["post-1821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-freebsd","category-howtos","category-phpmyadmin","tag-freebsd-12","tag-freebsd-phpmyadmin","tag-install-phpmyadmin-on-freebsd","tag-install-phpmyadmin-with-apache-on-freebsd","tag-phpmyadmin","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1821"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=1821"}],"version-history":[{"count":11,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1821\/revisions"}],"predecessor-version":[{"id":21073,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/1821\/revisions\/21073"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/16960"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=1821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=1821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=1821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}