2021-01-12 17:00

What's the idea of keeping an up to date phpmyadmin version running

Hey guys,

i'm currently wondering what's the intended and most sustainable way to install phpmyadmin and keep it up to date without any further actions, besides let's say, major updates.

I thought about using git and checking out STABLE, no brainer to automate via cronjob. But when checking out STABLE with git there are no CSS included: https://github.com/phpmyadmin/phpmyadmin/tree/STABLE/themes/pmahomme/css

I've read https://docs.phpmyadmin.net/en/latest/setup.html after, but i ask myself why i should bloat my installation with yarn, nodejs and composer?

Using composer and installing 5.0.0 (to try to get an update because that's the process that matters) works, but updating does not.

./composer.phar create-project phpmyadmin/phpmyadmin "5.0.0" -d pma/ 5.0.0 --no-dev trying update: ./composer.phar u phpmyadmin/phpmyadmin -d pma/5.0.0/ --no-dev This does only update dependencies, well, that's what composer for, i guess. But the pma installation is not updated.

So, what's the intended way to install and update pma in a way that is automated, and does not require additional dependencies.

That could be solved from my pov with including everything needed in the STABLE branch, but currently there are CSS files missing.

Juggling around with tar balls and guessing versions does not feel right, there has to be a better way to implement an upgrade strategy that does not bring 3 dependencies i'd also have to take care of.


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39874589 weixin_39874589 4月前

    https://github.com/phpmyadmin/composer/tree/5.0.x will keep up to date with 5.0 versions etc...

    点赞 评论 复制链接分享
  • weixin_39887926 weixin_39887926 4月前

    This is a good question and I don't think there's really a "one size fits all" solution.

    STABLE branch

    For some of my servers, I don't mind the extra overhead of git, yarn, node, and composer so I actually do what you first thought of; I have a very small script that runs weekly and checks out the latest changes from STABLE, the runs the other programs (composer and yarn) to update dependencies and generate the CSS.

    However, the extra program requirements can be a burden, and I understand if that's not an ideal solution for you.

    Downloading the latest

    You could download the latest file on some schedule (perhaps monthly?) and always replace your existing installation. This requires extra download traffic but is probably the easiest to script. The latest file is always available for download as a shortcut through the URL William mentioned (or several variations, for other compression types or the English-only version). You can see all the available downloads listed about two thirds of the way down https://www.phpmyadmin.net/downloads/

    Checking latest version

    We publish several feeds showing the latest version which you could use to write a small script to test and download a newer version. The complete list is shown at https://www.phpmyadmin.net/about-website/#syndicate (I personally prefer https://www.phpmyadmin.net/home_page/version.txt). You could parse that file, check if you're using the most recent version, and download a new one if it's available.

    Composer package

    As you seem to have seen, there is a Composer package. The command composer create-project phpmyadmin/phpmyadmin should pull the latest version, and subsequently running composer update should keep you updated. I'm not sure what problem you encountered that it didn't work right and we could work more on troubleshooting that if you want.

    I'm not a big fan of this simply because Composer is meant more for dependency management than installing a software package, but it still should work.


    If you don't like running the dependencies yarn and composer, you might not want to install Docker either, but if you happen to already have it on your system then the Docker image can be a great way to deploy phpMyAdmin. Our documentation has a whole section on the Docker image, which can be as simple as docker pull phpmyadmin/phpmyadmin or much more complex with Docker volumes and extended configuration directives.

    Package manager

    Most popular distributions have a packaged version of phpMyAdmin available, including Homebrew for the Mac. Members of the phpMyAdmin team help on the Debian and Ubuntu package, and Remi continues to do an outstanding job of maintaining the RPM version, and has for many years. If you have a packaged version available, that can be a great way of keeping updated with probably the least effort of all the available options.


    For a long time, we have avoided any kind of automatic updates because of the pitfalls of various deployments: between Windows, Mac, and Linux compatibility and various restrictions placed by web hosts, it's a very large (and moving) target to safely allow the program to update its files automatically. We can't insure what permissions or PHP restrictions the program will run with, so we feel automatic updates are not ideal. Aside from that, there are quite a number of ways to keep updated and I hope one of them works for you.

    点赞 评论 复制链接分享
  • weixin_39957186 weixin_39957186 4月前

    Thank's again for your replies, i appreciate it.

    It certainly depends on what one want's to achieve. I'd like to provide an easy to run through guide to setup an auto-updating installation. The update routine should be a one line crontab entry to avoid any overhead.

    This exludes parsing version files and handling tar archives, as it should happen in a user context it also excludes package managers and docker as well as additional software stacks.

    It comes down to either git or composer.

    Is there a STABLE branch in https://github.com/phpmyadmin/composer ? From what i see the changes from MASTER in the main project are being imported daily (correct me if i'm wrong or am overlooking something).

    I'd prefer that solution over the composer one, but i wonder as well why i can't pull updates if i checkout 5.0.0 . Would composer.{json,lock} help to identify possible issues there?

    点赞 评论 复制链接分享
  • weixin_39887926 weixin_39887926 4月前

    At the moment, we do not have a stable branch of Composer. We can probably add that functionality, though.

    If you're running ./composer.phar create-project phpmyadmin/phpmyadmin "5.0.0" -d pma/ 5.0.0 --no-dev, then trying to update that, I think I see the problem. The 5.0.0 tag pulls exactly version 5.0.0. If, for some reason, we would publish a change to the version 5.0.0 release (which we wouldn't do, it would be 5.0.1 or or maybe even 5.0.0-1), then your composer update would fetch those new changes. But since you're specifically checking out 5.0.0, then you don't get the newer versions.

    We should keep this ticket open for a bit to research whether it's practical to build a stable tag for composer.

    点赞 评论 复制链接分享
  • weixin_39957186 weixin_39957186 4月前

    I think a stable branch is pretty essential, doesn't the way it is right now mean every composer installation is always a dev branch unless you use --repository-url=https://www.phpmyadmin.net/packages.json ?

    Anyways, for my plans and need a stable composer branch would solve my problem, even though i would use git to check it out and that feels a bit like misusing the intention of it.

    点赞 评论 复制链接分享
  • weixin_39789101 weixin_39789101 4月前

    I run this shell script once a day via cron. It has been keeping my phpmyadmin up to the latest stable release for a couple of years so far.

    shell script
    cd $pmapath
    /usr/local/bin/composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json  --no-dev --prefer-dist --no-install
    rsync -ar "${pmapath}/phpmyadmin/" $pmapath
    rm -rf "${pmapath}/phpmyadmin/"
    点赞 评论 复制链接分享
  • weixin_39851307 weixin_39851307 4月前

    Using the (a?) package manager would be the obvious answer..

    点赞 评论 复制链接分享
  • weixin_39874589 weixin_39874589 4月前


    A cron that downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip and unzips the file seems enough for me.

    Or you could have a look to our https://github.com/phpmyadmin/docker version and pull latest tag

    点赞 评论 复制链接分享
  • weixin_39957186 weixin_39957186 4月前

    Thanks for your quick answer.

    Unfortunately, downloading tar balls or similiar will require one to remove existing installations. If you would do it in a proper way, you would have to actively delete stuff on the system, because just extracting over an existing destination folder would not remove obsolete files and therefore imply potential security risks.

    Downloading a latest release also would just blindly download things without even checking if there is a need for an update. I could compare md5 / sha sums, but that makes it overly complicated if you compare it to a possible git pull, that has the whole logic already built in.

    Running docker is the same as running additional dependencies like nodejs, yarn and composer: i don't want to take care of a stack of dependencies, this is overcomplicating things instead of keeping them simple. KISS is really the point here, and the easiest would be using git. Is there a reason why the git checkout does not include CSS files?

    点赞 评论 复制链接分享
  • weixin_39874589 weixin_39874589 4月前

    Is there a reason why the git checkout does not include CSS files?

    Yes, because they are now generated files ;)

    That said https://github.com/phpmyadmin/composer has all the GIT logic and has the CSS files pushed into the history. Could that repository fit your expectations ?

    点赞 评论 复制链接分享