Fix for phpMyAdmin on Ubuntu 16.04 / NGINX 1.10 / PHP 7

Don't let phpMyAdmin give you headaches

I was slowly getting behind of the new cool things out there. Although I’m already dedicated to the superior LEMP stacks with MariaDB and the phpMyAdmin tool for quite a while now, they were al running Linux Ubuntu 14.04 (one even 12.02), NGINX 1.4 (or 1.2), PHP 5.x and MariaDB. While this might be perfect for some (most) people, I’m quite obsessive when it comes to having the newest and latest (stable) packages installed. So these past two weeks I did exactly that.

All my servers (at VULTR and DigitalOcean, not my Raspberry 3 home server) currently have the following setup:

• Linux Ubuntu 16.04 (xenial)
• nginx/1.10.0
• MariaDB server 10.0.24
• PHP 7.0.4
• phpMyAdmin 4.6.1
• OpenSSL 1.0.2g (with Let’s Encrypt)
• postfix 3.1.0

When configured correctly, websites hosted on these servers are blazingly fast. Especially using HTTPS with the HTTP/2 network protocol and the ALPN TLS extension.

PhpMyAdmin_logoThis article will focus on phpMyAdmin. Where I have never encountered issues in the past with phpMyAdmin I couldn’t get it to work properly. First I got a blank page and when I resolved that issue wouldn’t let me login. Maybe you are having the same issues and are lost for solutions? No worries, try the following easy fixes to see if that solves it.

Fix 1: Where to get phpMyAdmin from?

First tip, when you are using all the latest packages, make sure to also include this trusted one for the most recent phpMyAdmin build:

sudo add-apt-repository ppa:nijel/phpmyadmin

After adding this repository simply do an apt-get update and apt-get upgrade and/or apt-get dist-upgrade to get the latest phpMyAdmin version. This might already fix your issue (lucky you!).

Fix 2: phpMyAdmin shows a blank / white page!?

Nothing more dreadful than a blank page with no feedback of what could be wrong. After going through the error logs I found out it has something to do with php-gettext. I think it is currently embedded in php7.0-common, hence no longer a separate package. phpMyAdmin seems to not know this yet, so you’l need to install php-gettext. This will make the phpMyAdmin render in your browser again.

apt-get install php-gettext
Fix 3: Access denied for root

Schermafbeelding 2016-05-21 om 08.26.02

In the past few years I was always able to log in to phpMyAdmin with the root account. Now, this didn’t work anymore. At first I thought something went wrong with the installation of either MariaDB (the MySQL server) or phpMyAdmin or even PHP. So I started over several times (thankfully it’s super easy with VULTR and DigitalOcean), reconfiguring everything, but the error persisted.

Then I started to search a little bit further and found in a recent question on that:

MySQL 5.7 changed the secure model, not allowing MySQL root user login without sudo (while the password can be blank) anymore.

You can find the full question and very good answer, with a detailed explanation on how to create new superuser for MySQL, in this link here.


Hopefully this guide offered some useful fixes for you. In my case I had to use all of then before phpMyAdmin worked properly. Good luck!


  1. Meher

    Hey, how can i setup my server as like as you have? is there any details guide step by step?

    Linux Ubuntu 16.04 (xenial)
    • nginx/1.10.0
    • MariaDB server 10.0.24
    • PHP 7.0.4
    • phpMyAdmin 4.6.1
    • OpenSSL 1.0.2g (with Let’s Encrypt)
    • postfix 3.1.0

  2. Mahesh Patil

    thanks for very helpful tutorial. It really workd for me. For the last 15 days i was trying to install nginx php mysql phpadmin on my linuxmint 18 and ubuntu 16. but the phpmyadmin page was getting blank. i tried everything but all was in vain. the issue was due to php-gettext, and the command provided here resolved my issue. thanks for help.

  3. Antonio

    Thank you!!

Leave a Comment.