{"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 class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1065\" height=\"596\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-phpmyadmin-on-freebsd.png\" alt=\"\" class=\"wp-image-16963\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-phpmyadmin-on-freebsd.png?v=1685862161 1065w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/install-phpmyadmin-on-freebsd-768x430.png?v=1685862161 768w\" sizes=\"(max-width: 1065px) 100vw, 1065px\" \/><\/figure>\n\n\n\n<p>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<p>phpMyAdmin comes bundled with a handful features which you can check them from <a href=\"https:\/\/www.phpmyadmin.net\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing phpMyAdmin on FreeBSD 12<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Install FEMB\/FAMB Stack<\/h4>\n\n\n\n<p>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<p><a href=\"https:\/\/kifarunix.com\/install-nginx-mysql-php-femp-stack-on-freebsd-12\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install FEMP Stack on FreeBSD 12<\/a><\/p>\n\n\n\n<p><a title=\"Install Apache, MySQL, PHP (FAMP) Stack on FreeBSD 12\" href=\"https:\/\/kifarunix.com\/install-apache-mysql-php-famp-stack-on-freebsd-12\/\" target=\"_blank\" rel=\"bookmark noopener\">Install FAMB Stack on FreeBSD 12<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install Required PHP Modules<\/h4>\n\n\n\n<p>Install the required PHP extensions if you have not done so already;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pkg install php82-session php82-mbstring php82-mysqli wget curl php82-filter<\/pre>\n\n\n\n<p>You can verify the presence of the above PHP extensions by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php -m | egrep \"json|mbstring|session|mysqli|hash|filter\"<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>hash\njson\nmbstring\nmysqli\nsession\nfilter<\/code><\/pre>\n\n\n\n<p>If not enabled by default, edit the <code>\/usr\/local\/etc\/php.ini<\/code> and add the following lines to load the extensions installed above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/usr\/local\/etc\/php.ini<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">extension=mysqli.so\nextension=mbstring.so\nextension=json.so\nextension=session.so\nextension=filter.so<\/pre>\n\n\n\n<p>Save and quit the file.<\/p>\n\n\n\n<p>Restart Apache and confirm again using <strong><code>php -m<\/code><\/strong> command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service apache24 restart<\/code><\/pre>\n\n\n\n<p>Assuming you have FAMB\/FEMB Stack with the necessary PHP extensions up and running, proceed as follows;<\/p>\n\n\n\n<p>Note, we are using FAMB in this guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Download phpMyAdmin package<\/h3>\n\n\n\n<p>In order to get the latest version of phpMyAdmin running on your server, navigate to the <a href=\"https:\/\/www.phpmyadmin.net\/downloads\/\" target=\"_blank\" rel=\"noopener\">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<p>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<p>Replace the value of the VER variable below with the current release version of phpMyAdmin;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set VER=5.2.1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER\/phpMyAdmin-$VER-english.zip<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Verify Integrity of phpMyAdmin Package<\/h4>\n\n\n\n<p>Verify that the downloaded file is not corrupted by comparing that SHA256 hash for the two files matches.<\/p>\n\n\n\n<p>From the phpMyAdmin download page, download the SHA256 file for the <code>phpMyAdmin-$VER-english.zip<\/code> into the same directory where phpMyAdmin package is;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/$VER\/phpMyAdmin-$VER-english.zip.sha256<\/code><\/pre>\n\n\n\n<p>To check the SHA256 for the downloaded file, run the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sha256sum -c phpMyAdmin-$VER-english.zip.sha256<\/pre>\n\n\n\n<p>Output;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phpMyAdmin-5.2.1-english.zip: OK<\/code><\/pre>\n\n\n\n<p>Great, the hashes match and we are good to proceed.<\/p>\n\n\n\n<p>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<h3 class=\"wp-block-heading\">Install phpMyAdmin on FreeBSD 12<\/h3>\n\n\n\n<p>Unzip the phpMyAdmin package downloaded above and move it to Apache Web Root directory, <code>\/usr\/local\/www\/apache24\/data<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">unzip phpMyAdmin-$VER-english.zip<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">mv phpMyAdmin-$VER-english \/usr\/local\/www\/apache24\/data\/phpmyadmin<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">CONFIGURE PHPMYADMIN<\/h3>\n\n\n\n<p>phpMyAdmin has been installed and thus can be configured as follows;<\/p>\n\n\n\n<p>Navigate to the <code>\/usr\/local\/www\/apache24\/data\/phpmyadmin<\/code> and rename the PHP configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/usr\/local\/www\/apache24\/data\/phpmyadmin<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">cp config{.sample,}.inc.php<\/pre>\n\n\n\n<p>Create a <code>tmp<\/code> folder for caching templates and set proper permissions;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod 755 \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>chown -R www:www \/usr\/local\/www\/apache24\/data\/phpmyadmin\/tmp<\/code><\/pre>\n\n\n\n<p>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<p>You can generate the secret;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl rand -hex 16<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>8e41a8be54813c6b8f34b0fe6ebb5edb<\/code><\/pre>\n\n\n\n<p>and paste as follows;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi \/usr\/local\/www\/apache24\/data\/phpmyadmin\/config.inc.php<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>...\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>...<\/strong><\/pre>\n\n\n\n<p>Save and Exit the file<\/p>\n\n\n\n<p>Restart Apache for the changes to take effect.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service apache24 restart<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Access phpMyAdmin Web Interface<\/h3>\n\n\n\n<p>To access phpMyAdmin dashboard, navigate to the browser and enter the URL in the format, <code>http:\/\/server-IP\/phpmyadmin<\/code>. This will take you to phpMyAdmin login page.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"471\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-web-login-page.png\" alt=\"Install phpMyAdmin on FreeBSD\" class=\"wp-image-16982\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-web-login-page.png?v=1685870025 958w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-web-login-page-768x378.png?v=1685870025 768w\" sizes=\"(max-width: 958px) 100vw, 958px\" \/><\/figure>\n\n\n\n<p>Login with MySQL database root credentials.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1892\" height=\"943\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-dashboard.png\" alt=\"\" class=\"wp-image-16983\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-dashboard.png?v=1685870813 1892w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-dashboard-768x383.png?v=1685870813 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-dashboard-1536x766.png?v=1685870813 1536w\" sizes=\"(max-width: 1892px) 100vw, 1892px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Running Database Queries on phpMyAdmin<\/h3>\n\n\n\n<p>You can see a list of databases on the left side of the phpMyAdmin Dashboard;<\/p>\n\n\n\n<p>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 class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1677\" height=\"921\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-database-tables.png\" alt=\"\" class=\"wp-image-16984\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-database-tables.png?v=1685871113 1677w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-database-tables-768x422.png?v=1685871113 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/phpmyadmin-database-tables-1536x844.png?v=1685871113 1536w\" sizes=\"(max-width: 1677px) 100vw, 1677px\" \/><\/figure>\n\n\n\n<p>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<p>For example;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT User, Host, Plugin FROM user WHERE User = 'root';<\/code><\/pre>\n\n\n\n<p>Once you have the query, click on the &#8220;Go&#8221; button to execute the query.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1905\" height=\"685\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/run-mysql-queries-on-phpmyadmin.png\" alt=\"\" class=\"wp-image-16985\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/run-mysql-queries-on-phpmyadmin.png?v=1685871348 1905w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/run-mysql-queries-on-phpmyadmin-768x276.png?v=1685871348 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/run-mysql-queries-on-phpmyadmin-1536x552.png?v=1685871348 1536w\" sizes=\"(max-width: 1905px) 100vw, 1905px\" \/><\/figure>\n\n\n\n<p>After execution, the results of your query will be displayed below the SQL query box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1531\" height=\"675\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/query-results-phpmyadmin.png\" alt=\"\" class=\"wp-image-16986\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/query-results-phpmyadmin.png?v=1685871570 1531w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/06\/query-results-phpmyadmin-768x339.png?v=1685871570 768w\" sizes=\"(max-width: 1531px) 100vw, 1531px\" \/><\/figure>\n\n\n\n<p>You can continue executing more queries by writing them in the SQL query box and clicking &#8220;Go&#8221; each time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other Tutorials<\/h2>\n\n\n\n<p>You can also check our previous articles on LAMP\/LEMP Stack using the following links;<\/p>\n\n\n\n<p><a title=\"How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29\" href=\"https:\/\/kifarunix.com\/how-to-install-lamp-linux-apache-mysql-php-stack-on-fedora-28-29\/\" rel=\"bookmark\">How To Install LAMP (Linux, Apache, MySQL, PHP) Stack on Fedora 28\/29<\/a><\/p>\n\n\n\n<p><a title=\"How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS\" href=\"https:\/\/kifarunix.com\/how-to-install-lamp-stack-apachemariadb-php-7-2-on-ubuntu-18-04-lts\/\" rel=\"bookmark\">How to Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n<p><a title=\"How to Install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29\" href=\"https:\/\/kifarunix.com\/how-to-install-lemp-nginxmariadbphp7-2-stack-on-fedora-28-fedora-29\/\" rel=\"bookmark\">How to Install LEMP (Nginx,MariaDB,PHP7.2) Stack on Fedora 28 \/ Fedora 29<\/a><\/p>\n\n\n\n<p><a title=\"How To Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04\" href=\"https:\/\/kifarunix.com\/how-to-setup-lemp-stack-nginx-mariadb-php-7-2-on-ubuntu-18-04\/\" rel=\"bookmark\">How To Setup LEMP Stack (Nginx, MariaDB, PHP 7.2) on Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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}]}}