8

Install based on https://www.howtoforge.com/tutorial/ubuntu-postgresql-installation/ in my ubuntu 16.04

Log into http://localhost/phppgadmin/ PostgreSQL, browser show Version of PostgreSQL not supported. Please upgrade to version or later.

Any resolution?

2
  • I'm using the latest version 10 which its the latest.So why it still happen? Commented Oct 18, 2017 at 1:19
  • FYI phpPgAdmin is now being actively developed again, and supports up to v11.x Commented Apr 8, 2019 at 10:02

6 Answers 6

21

Actually you still can modify this file manually:

classes/database/Connection.php

// Detect version and choose appropriate database driver switch (substr($version,0,3)) { case '9.5': return 'Postgres'; break; case '9.4': return 'Postgres94'; break; case '9.3': return 'Postgres93'; break; case '9.2': return 'Postgres92'; break; case '9.1': return 'Postgres91'; break; case '9.0': return 'Postgres90'; break; case '8.4': return 'Postgres84'; break; case '8.3': return 'Postgres83'; break; case '8.2': return 'Postgres82'; break; case '8.1': return 'Postgres81'; break; case '8.0': case '7.5': return 'Postgres80'; break; case '7.4': return 'Postgres74'; break; } switch (substr($version,0,4)) { case '10.1': return 'Postgres'; break; } 

Not fully tested, but all the main functions work fine.

Or create your own fork of https://github.com/phppgadmin/phppgadmin and create/fix a couple of files for implementing full support.

Sign up to request clarification or add additional context in comments.

4 Comments

Fantastic. Working fine.
Awesome! I just handled all the v10 with the following: switch (substr($version,0,2)) { case '10': return 'Postgres'; break; }
Great solution!
How to stop postgresql from updating itself from time to time?
9

EDIT 3: phpPgAdmin is in active development again! If you download the latest version, it supports PostgreSQL up to v11.x

http://phppgadmin.sourceforge.net/doku.php?id=download https://github.com/phppgadmin/phppgadmin


phpPgAdmin hasn't been actively developed for years. It's still a great interface for PostgreSQL, but unfortunately they only officially support up to 9.2. I've noticed that the latest version still works up to 9.6 though, at least it has in a production environment for the past 6 months, and before that worked with whatever I had (9.4 / 9.5?) for years.

I would suggest installing 9.6 instead, and going from there.

EDIT: If you're dead keen on using v10, then you can still use pgAdmin 4 as the interface, though this is not web based.

Reference: Official phpPgAdmin Website

EDIT2: See the answer by DToch for a good workaround

2 Comments

Ok,it did support 9.6 and not support 10. Now it show. I hope this help others who have the same issue.Thanks.
As of now, phpPgAdmin is alive and had a release recently supporting up to version 11.
8

To be clearer, the full path is /usr/share/phppgadmin/classes/database/Connection.php

Also you can simply add

default: return 'Postgres'; break; 

at the end of the switch statement.

Also needed is the username for logging in should be "postgres". Not well documented.

Comments

3

If you're using docker (Using my fork of phppgadmin due that fixes compatibility with newer posrgres):

FROM php:8-fpm-alpine RUN apk add --no-cache --virtual \ .build-deps git autoconf g++ make postgresql-dev \ && docker-php-ext-install pgsql \ && docker-php-ext-enable opcache \ && apk add libpq ca-certificates curl apache2-proxy \ && rm -rf /var/www/localhost/.git/ /var/www/localhost \ && git clone https://github.com/idontusenumbers/phppgadmin.git /var/www/localhost/htdocs \ && rm -rf /var/www/localhost/.git/ \ && apk del .build-deps \ && rm -rf /tmp/* \ && rm -rf /var/cache/apk/* \ && rm /etc/init.d/apache2 RUN echo "ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/localhost/htdocs/$1" >> /etc/apache2/httpd.conf RUN echo "DirectoryIndex index.php" >> /etc/apache2/httpd.conf 

3 Comments

Hi, I replied your comment because you mentioned on docker. I tried to use your Dockerfile script, but I got error of "PHP version is not supported whenever I try to access the phppgadmin page. Please use 7.2 or above." So I build a PHP container on the same network, but the phppgadmin it doesn't detect the PHP container as I still got the error message. Any help? I ran the phppgadmin on Docker. Thank you.
This phppgadmin container here contains a copy of PHP. Although I've changed since I posted this, I'll update.
Thanks for the updated code!. Turns out that the dockage/phppgadmin image didn't support for Postgresql 13 yet, (I guess so). Your original post works if downgraded the version into 11. I will try to use your new edited version from now on. :D
0

in phppgadmin folder edit the file classes/database/Connection.php

Add after this line: case '7.4': return 'Postgres74'; break;

type or copy/paste this text: default: return 'Postgres'; break;

Et voila!

Comments

0

in the directory classes/database adjust the file connection.php switch (substr($version,0,3)) {

 case '9.2': return 'Postgres'; break; case '9.1': return 'Postgres91'; break; case '9.0': return 'Postgres90'; break; case '8.4': return 'Postgres84'; break; case '8.3': return 'Postgres83'; break; case '8.2': return 'Postgres82'; break; case '8.1': return 'Postgres81'; break; case '8.0': case '7.5': return 'Postgres80'; break; case '7.4': return 'Postgres74'; break; default: return 'Postgres'; break; } 

and it works also for version 10 without issues.

This also solves the issue when you have the following error message: Undefined variable: postgresqlMinVer Version of PostgreSQL not supported. Please upgrade to version or later.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.