Install phpMyAdmin with Nginx I tend to work mainly from the command line now. I never used to. I used to be scared of the command line but after forcing myself to use it, by removing any GUI tool I had, I have now overcome this fear and have embraced the ease and unlimited uses the command line brings.
I do however, still have a need for a few GUI tools. PhpMyAdmin is one of those tools I do tend to use from time to time. Sometimes, I don’t have access to the command line, whether I don’t have VPN access to my home network or don’t have my SSH keys on the device I am on.
My web servers now use Nginx along with a concoction of other services like Varnish and Elasticsearch. I also don’t like to have anything installed that I don’t need.
This being the case, I wanted to use phpMyAdmin without Nginx. I did not want to install Apache as I have a strong dislike for it and it’s unnecessary in my case.
The following guide explains how to install phpMyAdmin on a server running Nginx and PHP7.0-FPM on a Debian Jessie box.
- MySQL or MariaDB
First, make sure your server is up-to-date.
Next, install phpMyAdmin:
You’ll see the following screen. Press tab and then enter. This way you’re not installing any configuration files.
Installing phpMyAdmin will automatically install Apache, unfortunately. This is fine, but it will cause an issue in this case as both Apache and Nginx will be trying to listen to port 80 by default. So something is going to break!
So, let’s remove Apache:
Lets create a symbolic link to our www-data folder so that we can access phpMyAdmin from our browser:
Next, we need to make a new Nginx host file to bring everything to life. Just make sure to change the server_name to the url you’d like your installation to be accessible from:
You should now be able to access phpMyAdmin by going to the domain you specified in the server_name field.