phpMyAdmin configuration on UbuntuServer for SQL Server Management

Desired Outcome
Confirm installation and configuration of phpMyAdmin, to managed SQL Server databases on a local UbuntuServer.
Note: I think I had partially gone down this path before on a CentOS Server –

What is phpMyadmin?
phpMyAdmin is a free software tool written in PHP that is intended to handle the administration of a MySQL or MariaDB database server. You can use phpMyAdmin to perform most administration tasks, including creating a database, running queries, and adding user accounts. Many people have difficulty understanding the concept of user management with regards to phpMyAdmin. When a user logs in to phpMyAdmin, that username and password are passed directly to MySQL. phpMyAdmin does no account management on its own (other than allowing one to manipulate the MySQL user account information); all users must be valid MySQL users.

Requirements –
I need the following:
-WebServer — I know Apache is currently running on this UbuntuServer
-PHP – PHP 7.1.3 or newer, with session support, the Standard PHP Library (SPL) extension, hash, ctype, and JSON support.
-Database – phpMyAdmin supports MySQL-compatible databases. Minimal database versions are: MySQL 5.5 or newer OR MariaDB 5.5 or newer
-Web Browser – currently using Firefox on Mac. To access phpMyAdmin you need a web browser with cookies and JavaScript enabled

WebServer – confirming running and which version
-Went to internal web-site (that is running on local UbuntuServer that is on same LAN as Mac) and main web-page says Ubuntu Apache2 is running
-NOTE: Remembered that I have ZoneMinder installed, so this will be interesting. I never completely finished the ZoneMinder project, but it’s been running.
Q: How to stop the apache process?
A: sudo systemctl stop apache2
Note: When I went to the web-site it had timed out. To be expected
Q: How to start the apache process?
A: sudo systemctl start apache2
Note: As expected, the web-site is now up again
Q: How to check overall configuration of webserver?
A: sudo apachectl -t (Note: it came back with Syntax OK, but also: Could not reliably determine the server’s fully qualified domain name, using Set the ‘ServerName’ directive globally to suppress this message. This means I may need to address the internal FQDN.
Q: To check status of Apache?
A: sudo systemctl status apache2 – Overall, looks OK, but it’s focusing on FQDN
Q: What is the version of Apache2?
A: sudo apache2 -v
Server version: Apache/2.4.18 (Ubuntu)
Server built: 2017-09-18T15:09:02
Q: What is the basic difference between Apache and Apache Tomcat?
A: Apache is a webserver that serves basic .html pages. Apache Tomcat is an application server designed to server java applications
Note: At this point, I’m not sure if I need Apache Tomcat installed for myPHPAdmin. The myPHPAdmin requirement just says Apache webserver

PHP – confirming which version of PHP is installed
Q: How to know which version of PHP is installed?
A: php -v
PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Note: Looks like I need to update PHP because I need at least version 7.1.3

Database versions – what do I have and which version?
NOTE: I have UbuntuServer, which is Debian
NOTE: I’m not sure if I have SQL databases right now
Q: How do I know if I have SQL running?
A: /etc/init.d/mysql status
mysql.service – MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-11-23 23:14:22 PST; 2 months 9 days ago
Q: How to check version of mysql?
A: mysql -V
mysql Ver 14.14 Distrib 5.7.20, for Linux (i686) using EditLine wrapper

Updating and Upgrading UbuntuServer – OS, PHP, etc
Q: How to update the installer files so that I can upgrade
A: sudo apt-get update
Q: How to upgrade the OS and various versions of applications
A: sudo apt-get upgrade
Note: php -v (is now version 7.0.33, but that’s not enough)

NOTE: After all that, there is an option to upgrade to the newest version 18.04.3 LTS
Run ‘do-release-upgrade’ to upgrade to it — I’ll do that next, as I don’t believe I have the required versions of PHP, etc

Upgrading to newest UbuntuServer

Note: It came back with, Please install all available updates for your release before upgrading
Note: Looks like the newest Ubuntu ships with PHP 7.2 –
Note: This web-post mentions the error I received about installing all available updates first before upgrading —
Q: What are the steps?
A: sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade
sudo do-release-upgrade
Note: I needed to do a reboot first after updating the packages
sudo reboot now
do-release-upgrade — Now I have progress.

Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will
be started on port ‘1022’. If anything goes wrong with the running
ssh you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As
this is potentially dangerous it’s not done automatically. You can
open the port with e.g.:
‘iptables -I INPUT -p tcp –dport 1022 -j ACCEPT’

Not enough free disk space

The upgrade has aborted. The upgrade needs a total of 96.5 M free
space on disk ‘/boot’. Please free at least an additional 65.3 M of
disk space on ‘/boot’. You can remove old kernels using ‘sudo apt
autoremove’ and you could also set COMPRESS=xz in
/etc/initramfs-tools/initramfs.conf to reduce the size of your

Messages after upgrade
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-76-generic i686)
You have packages from the Hardware Enablement Stack (HWE) installed that
are going out of support on 2023-04-30.

There is a graphics stack installed on this system. An upgrade to a
configuration supported for the full lifetime of the LTS will become
available on 2020-07-21 and can be installed by running ‘update-manager’
in the Dash.

System checks (after upgrade)
PHP 7.2.24-0ubuntu0.18.04.2 (cli) (built: Jan 13 2020 18:39:59) ( NTS )
Note: That’s good

Installation of phpMyAdmin
Note: I don’t think I currently have a version of this installed. There is no \phpmyadmin folder under \etc
Instructions for installation –

sudo apt update
sudo apt install phpmyadmin php-mbstring php-gettext

Configure database for phpmyadmin with dbconfig-common
Note: I don’t think I have a database yet, so said Yes

Gave the database a password

Note: On first installation of myphpadmin, I hadn’t quite selected “apache2” — needed to press space bar to create an *

In order to reinstall — sudo dpkg-reconfigure phpmyadmin
Error: The mbstring extension is missing. Please check your PHP configuration.
Note: The installation process adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is read automatically. The only thing you need to do is explicitly enable the mbstring PHP extension, which you can do by typing:
sudo phpenmod mbstring
Error: WARNING: Module mbstring ini file doesn’t exist under /etc/php/7.0/mods-available
Note: Weird why it’s saying PHP version 7.0
Note: Went to a forum where someone had same issue with mbstring error

sudo apt install php7.0-mbstring
Note: Unable to locate package

Note: Went to another forum
I came here because I had trouble installing Phpmyadmin on Ubuntu after I upgrade from php 7.0 to 7.1
Note: I had upgrade to PHP 7.2
Here is the trick:

1) remove php version (7.0 for instance – adapt the command line)

sudo apt-get purge php7.0-common
Note: Done

Note –> You should check the list of packaged that will be removed.

2) Install php modules

sudo apt-get install php7.2-mbstring
Note: I didn’t do this — sudo apt-get install php7.1-mcrypt

3) activate the modules

sudo phpenmod mbstring — Note: Worked this time
Note: I didn’t do this — sudo phpenmod mcrypt

(option for apache) activate php7.2

sudo a2enmod php7.2

And of course restart your server (apache in this case)

sudo systemctl restart apache2

BAM!!!! — Now when I go to I get the myphpadmin menu for logging in!!!

Username for logging in is: myphpadmin
Password is on file

NOTE: This is info on enabling the firewall (UFW)

About Paul

CERT Coordinator, Ham Radio Operator, GTD Fan; Photographer; Domino/Notes Administrator
This entry was posted in Blog Development and tagged . Bookmark the permalink.