Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

radbonev's avatar

phpMyAdmin on Forge

Hello,

I am trying to setup a phpMyAdmin to work on Forge; however, it doesn't seem to work. I've tried to set it up as a normal LEMP, but it's not working. Is there anything specific that I need to do for forge?

I've already googled, but there's no answers.

Thank you in advance!

0 likes
23 replies
fideloper's avatar

We need to know what "doesn't work" means - error messages, behavior, what you're seeing - all that good stuff!

noeldiaz's avatar

If you want something lighter and that is way easier to install than phpMyAdmin I like this product a lot:

http://www.adminer.org

You can't go wrong with just one php page to set up! I do prefer dedicated clients though, especially ones that can do SSH tunneling so you can connect to the DB without opening any holes in firewall (Navicat, etc.).

noeldiaz's avatar

@radbonev Can you check your web servers error log file? It probably is not pointing to the right location of your phpMyAdmin install. Did you set up the virtual site and all that good stuff correctly? I would start there, seeing if that did not get set up right.

radbonev's avatar

@fideloper and @noeldiaz there are no errors in the /var/log/nginx/default-error.log file.

I will give adminer a try. As long as it covers the phpmyadmin feature set I should be fine!

bashy's avatar
bashy
Best Answer
Level 65

That's a really bad guide and I wouldn't use that.

I would install it from git

git clone --depth=1 --branch=STABLE git://github.com/phpmyadmin/phpmyadmin.git

Then add this to your default site/vhost

location /phpmyadmin {
    index index.php;
    auth_basic "Login";
    auth_basic_user_file /some/path/authbasic_mysql;
}

Optional (setup cron to update it daily)

pma_update.sh

#!/bin/bash
cd /some/path/to/phpmyadmin/
git pull -q origin STABLE

crontab -e

# Automatically upgrade phpMyAdmin daily (12am)
0 * * * * /path/to/pma_update.sh >/dev/null
5 likes
blomdahldaniel's avatar

@bashy your way seems way easier, could you maybe extend your instructions so a newbie (like me) can understand it? Where should i put the cloned repo? I am looking to go from a cpanel web-hosting towards Forge but I want to feel safe and in control and therefore want my myPhpAdmin so i can feel a bit at home. Could you maybe post some explanation for someone who is absolutely new to Forge?

And would your solution include all the necessary safety that is mentioned in the mentioned article?

bashy's avatar

@blomdahldaniel Well, it can be done on any host. I don't personally use Forge as I'm quite an advanced server admin and like to have full control over how I perform tasks. That aside, all you have to do is clone the repo into where you want the PHPMyAdmin files to appear (web files) and then just add basic_auth to the /route you choose for it.

I use it on my servers and it's perfectly secure. Uses the exact same basic_auth as that article does.

1 like
RobinMalfait's avatar

Or you could install sequel pro on mac, or HeidiSQL on windows :)

2 likes
IsaacBen's avatar

This worked for me:

  1. sudo apt-get update
  2. sudo apt-get install phpmyadmin
  3. sudo php5enmod mcrypt
  4. sudo service php5-fpm restart
  5. sudo nano /etc/nginx/sites-available/default - So you can see what is your root folder
  6. cd /home/forge/default/public - This should be the root if you use forge
  7. sudo ln -s /usr/share/phpmyadmin

I found that the problem is that we share the phpmyadmin at the wrong root folder, the guides in DigitalOcean don't focus on Forge and that's why their solutions are not good for us in that case

3 likes
maurolopes's avatar

Hey, @bashy, can you tell me the exact steps I should take? I tried the first two, but couldn't access phpmyadmin...

Shouldn't I install phpmyadmin after cloning it from github? Please, don't assume that I have any knowledge about this...

Thanks

bashy's avatar

@maurolopes Once you have the files from git (clone part), you just need to point a domain (sub-domain or IP as well) via your web server to the cloned files.

mikkellindblom's avatar

@bashy, do you mind doing giving an update on this one? Been trying to get it up and running for 2 days :)

bashy's avatar

I can't give any updates since I've not used it since. What problems you having?

aom's avatar

FYI, in case this could be useful to others. You don't need phpmyadmin on the server. If you have tool like Sequel Pro, you can connect using ssh to the database.

Please or to participate in this conversation.