How to install PostgreSQL server on Linux<\/a><\/p>\n\n\n\nInstall phpPgAdmin<\/h3>\n\n\n\n As of this writing, phpPgAdmin 7.13.0 is the current stable release and is fortunately available on Debian 12 repositories.<\/p>\n\n\n\n
As such, you can simply execute the command below to installing phpPgAdmin on Debian 12;<\/p>\n\n\n\n
apt install phppgadmin<\/code><\/pre>\n\n\n\nThe command will install all required packages and their dependencies.<\/p>\n\n\n\n
The default phpPgAdmin configuration file is \/etc\/phppgadmin\/config.inc.php<\/code><\/strong>. Below is the default configs;<\/p>\n\n\n\ncat \/etc\/phppgadmin\/config.inc.php<\/code><\/pre>\n\n\n\n\n<?php\n\n\t\/**\n\t * Central phpPgAdmin configuration. As a user you may modify the\n\t * settings here for your particular configuration.\n\t *\n\t * $Id: config.inc.php-dist,v 1.55 2008\/02\/18 21:10:31 xzilla Exp $\n\t *\/\n\n\t\/\/ An example server. Create as many of these as you wish,\n\t\/\/ indexed from zero upwards.\n\n\t\/\/ Display name for the server on the login screen\n\t$conf['servers'][0]['desc'] = 'PostgreSQL';\n\n\t\/\/ Hostname or IP address for server. Use '' for UNIX domain socket.\n\t\/\/ use 'localhost' for TCP\/IP connection on this computer\n\t$conf['servers'][0]['host'] = 'localhost';\n\n\t\/\/ Database port on server (5432 is the PostgreSQL default)\n\t$conf['servers'][0]['port'] = 5432;\n\n\t\/\/ Database SSL mode\n\t\/\/ Possible options: disable, allow, prefer, require\n\t\/\/ To require SSL on older servers use option: legacy\n\t\/\/ To ignore the SSL mode, use option: unspecified\n\t$conf['servers'][0]['sslmode'] = 'allow';\n\n\t\/\/ Change the default database only if you cannot connect to template1.\n\t\/\/ For a PostgreSQL 8.1+ server, you can set this to 'postgres'.\n\t$conf['servers'][0]['defaultdb'] = 'template1';\n\n\t\/\/ Specify the path to the database dump utilities for this server.\n\t\/\/ You can set these to '' if no dumper is available.\n\t$conf['servers'][0]['pg_dump_path'] = '\/usr\/bin\/pg_dump';\n\t$conf['servers'][0]['pg_dumpall_path'] = '\/usr\/bin\/pg_dumpall';\n\n\t\/\/ Example for a second server (PostgreSQL for Windows)\n\t\/\/$conf['servers'][1]['desc'] = 'Test Server';\n\t\/\/$conf['servers'][1]['host'] = '127.0.0.1';\n\t\/\/$conf['servers'][1]['port'] = 5432;\n\t\/\/$conf['servers'][1]['sslmode'] = 'allow';\n\t\/\/$conf['servers'][1]['defaultdb'] = 'template1';\n\t\/\/$conf['servers'][1]['pg_dump_path'] = 'C:\\\\Program Files\\\\PostgreSQL\\\\8.0\\\\bin\\\\pg_dump.exe';\n\t\/\/$conf['servers'][1]['pg_dumpall_path'] = 'C:\\\\Program Files\\\\PostgreSQL\\\\8.0\\\\bin\\\\pg_dumpall.exe';\n\n\n\t\/* Groups definition *\/\n\t\/* Groups allow administrators to logicaly group servers together under\n\t * group nodes in the left browser tree\n\t *\n\t * The group '0' description\n\t *\/\n\t\/\/$conf['srv_groups'][0]['desc'] = 'group one';\n\n\t\/* Add here servers indexes belonging to the group '0' separated by comma *\/\n\t\/\/$conf['srv_groups'][0]['servers'] = '0,1,2';\n\n\t\/* A server can belong to multi groups. Here server 1 is referenced in both\n\t * 'group one' and 'group two'*\/\n\t\/\/$conf['srv_groups'][1]['desc'] = 'group two';\n\t\/\/$conf['srv_groups'][1]['servers'] = '3,1';\n\n\t\/* A group can be nested in one or more existing groups using the 'parents'\n\t * parameter. Here the group 'group three' contains only one server and will\n\t * appear as a subgroup in both 'group one' and 'group two':\n\t *\/\n\t\/\/$conf['srv_groups'][2]['desc'] = 'group three';\n\t\/\/$conf['srv_groups'][2]['servers'] = '4';\n\t\/\/$conf['srv_groups'][2]['parents'] = '0,1';\n\n\t\/* Warning: Only groups with no parents appears at the root of the tree. *\/\n\n\t\/* You can apply specific theme depending on servers, users and databases\n\t * The priority order is :\n\t * * the theme defined for a server\n\t * * the theme defined for a database apply over the server one\n\t * * the theme defined for a user apply over the database one\n\t *\/\n\t\/* Example for servers *\/\n\t\/\/$conf['servers'][0]['theme']['default'] = 'default';\n\t\/* Example for users *\/\n\t\/\/$conf['servers'][0]['theme']['user']['specific_user'] = 'default';\n\t\/* Example for databases *\/\n\t\/\/$conf['servers'][0]['theme']['db']['specific_db'] = 'default';\n\n\t\/\/ Default language. E.g.: 'english', 'polish', etc. See lang\/ directory\n\t\/\/ for all possibilities. If you specify 'auto' (the default) it will use\n\t\/\/ your browser preference.\n\t$conf['default_lang'] = 'auto';\n\n\t\/\/ AutoComplete uses AJAX interaction to list foreign key values\n\t\/\/ on insert fields. It currently only works on single column\n\t\/\/ foreign keys. You can choose one of the following values:\n\t\/\/ 'default on' enables AutoComplete and turns it on by default.\n\t\/\/ 'default off' enables AutoComplete but turns it off by default.\n\t\/\/ 'disable' disables AutoComplete.\n\t$conf['autocomplete'] = 'default on';\n\n\t\/\/ If extra login security is true, then logins via phpPgAdmin with no\n\t\/\/ password or certain usernames (pgsql, postgres, root, administrator)\n\t\/\/ will be denied. Only set this false once you have read the FAQ and\n\t\/\/ understand how to change PostgreSQL's pg_hba.conf to enable\n\t\/\/ passworded local connections.\n\t$conf['extra_login_security'] = true;\n\n\t\/\/ Only show owned databases?\n\t\/\/ Note: This will simply hide other databases in the list - this does\n\t\/\/ not in any way prevent your users from seeing other database by\n\t\/\/ other means. (e.g. Run 'SELECT * FROM pg_database' in the SQL area.)\n\t$conf['owned_only'] = false;\n\n\t\/\/ Display comments on objects? Comments are a good way of documenting\n\t\/\/ a database, but they do take up space in the interface.\n\t$conf['show_comments'] = true;\n\n\t\/\/ Display \"advanced\" objects? Setting this to true will show\n\t\/\/ aggregates, types, operators, operator classes, conversions,\n\t\/\/ languages and casts in phpPgAdmin. These objects are rarely\n\t\/\/ administered and can clutter the interface.\n\t$conf['show_advanced'] = false;\n\n\t\/\/ Display \"system\" objects?\n\t$conf['show_system'] = false;\n\n\t\/\/ Minimum length users can set their password to.\n\t$conf['min_password_length'] = 1;\n\n\t\/\/ Width of the left frame in pixels (object browser)\n\t$conf['left_width'] = 200;\n\n\t\/\/ Which look & feel theme to use\n\t$conf['theme'] = 'default';\n\n\t\/\/ Show OIDs when browsing tables?\n\t\/\/ Only supported in versions <=11\n\t$conf['show_oids'] = false;\n\n\t\/\/ Max rows to show on a page when browsing record sets\n\t$conf['max_rows'] = 30;\n\n\t\/\/ Max chars of each field to display by default in browse mode\n\t$conf['max_chars'] = 50;\n\n\t\/\/ Send XHTML strict headers?\n\t$conf['use_xhtml_strict'] = false;\n\n\t\/\/ Base URL for PostgreSQL documentation.\n\t\/\/ '%s', if present, will be replaced with the PostgreSQL version\n\t\/\/ (e.g. 8.4 )\n\t$conf['help_base'] = 'http:\/\/www.postgresql.org\/docs\/%s\/interactive\/';\n\n\t\/\/ Configuration for ajax scripts\n\t\/\/ Time in seconds. If set to 0, refreshing data using ajax will be disabled (locks and activity pages)\n\t$conf['ajax_refresh'] = 3;\n\n\t\/** Plugins management\n\t * Add plugin names to the following array to activate them\n\t * Example:\n\t * $conf['plugins'] = array(\n\t * 'Example',\n\t * 'Slony'\n\t * );\n\t *\/\n\t$conf['plugins'] = array();\n\n\t\/*****************************************\n\t * Don't modify anything below this line *\n\t *****************************************\/\n\n\t$conf['version'] = 19;\n\n?>\n<\/pre><\/code>\n\n\n\nIn its basic setup, the default configurations suffice.<\/p>\n\n\n\n
Feel free to modify other settings as you see fit and save the changes when done.<\/p>\n\n\n\n
phpPgAdmin Web Server Configuration<\/h4>\n\n\n\n By default, phpPgAdmin uses Apache HTTP server. Upon installation, the phpPgAdmin HTTP server configuration is handled automatically.<\/p>\n\n\n\n
The default configuration file is \/etc\/apache2\/conf-available\/phppgadmin.conf<\/code><\/strong>.<\/p>\n\n\n\nThe default configs are ;<\/p>\n\n\n\n
cat \/etc\/apache2\/conf-available\/phppgadmin.conf<\/code><\/pre>\n\n\n\n\nAlias \/phppgadmin \/usr\/share\/phppgadmin\n\n<Directory \/usr\/share\/phppgadmin>\n\n<IfModule mod_dir.c>\nDirectoryIndex index.php\n<\/IfModule>\nAllowOverride None\n\n# Only allow connections from localhost:\nRequire local\n\n<IfModule mod_php.c>\n php_flag magic_quotes_gpc Off\n php_flag track_vars On\n #php_value include_path .\n<\/IfModule>\n<IfModule !mod_php.c>\n <IfModule mod_actions.c>\n <IfModule mod_cgi.c>\n AddType application\/x-httpd-php .php\n Action application\/x-httpd-php \/cgi-bin\/php\n <\/IfModule>\n <IfModule mod_cgid.c>\n AddType application\/x-httpd-php .php\n Action application\/x-httpd-php \/cgi-bin\/php\n <\/IfModule>\n <\/IfModule>\n<\/IfModule>\n\n<\/Directory>\n<\/pre><\/code>\n\n\n\nBy default, access is only allowed locally from within the host, Require local<\/code><\/strong>. To allow external access to the web server, change that line to Require all granted<\/strong>.<\/p>\n\n\n\nEnable phpPgAdmin configuration (it should already be enabled);<\/p>\n\n\n\n
a2enconf phppgadmin<\/code><\/pre>\n\n\n\nCheck for any Apache configuration errors;<\/p>\n\n\n\n
apache2ctl -t<\/code><\/pre>\n\n\n\nEnsure output is Syntax OK<\/strong>.<\/p>\n\n\n\nIf you make any changes to the Web server configurations, restart and enable Apache Web server to run on system boot (if not already enabled);<\/p>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\nsystemctl enable apache2<\/code><\/pre>\n\n\n\nAccessing phpPgAdmin Web Interface<\/h3>\n\n\n\n You should now be able to access phpPgAdmin web interface from the browser.<\/p>\n\n\n\n
Ensure to open the web server ports on firewall, if any is running.<\/p>\n\n\n\n
You can access phpPgAdmin web interface via http:\/\/your_domain_or_ip\/phppgadmin<\/code>. Replace your_domain_or_ip<\/code> with the domain name or IP address of your server.<\/p>\n\n\n\n <\/figure>\n\n\n\nLogin to PostgreSQL Server on phpPgAdmin by clicking on PostgreSQL under Servers.<\/p>\n\n\n\n
If upon login you get the error;<\/p>\n\n\n\n
Version of PostgreSQL not supported. Please upgrade to version or later.<\/strong><\/code><\/pre>\n\n\n\nYou need to update the phpPgAdmin configuration file to support PostgreSQL 15. Thus;<\/p>\n\n\n\n
vim \/usr\/share\/phppgadmin\/classes\/database\/Connection.php<\/code><\/pre>\n\n\n\nChange this section;<\/p>\n\n\n\n
\n\t\t\/\/ Detect version and choose appropriate database driver\n switch (substr($version,0,2)) {\n case '14': return 'Postgres';break;\n case '13': return 'Postgres13';break;\n case '12': return 'Postgres12';break;\n case '11': return 'Postgres11';break;\n case '10': return 'Postgres10';break;\n } \n<\/pre><\/code>\n\n\n\nInclude version 15 of PostgreSQL server;<\/p>\n\n\n\n
\n\t\t\/\/ Detect version and choose appropriate database driver\n switch (substr($version,0,2)) {\n case '15': return 'Postgres';break;<\/strong>\n case '14': return 'Postgres14';break;\n case '13': return 'Postgres13';break;\n case '12': return 'Postgres12';break;\n case '11': return 'Postgres11';break;\n case '10': return 'Postgres10';break;\n } \n<\/pre><\/code>\n\n\n\nSave and exit the file.<\/p>\n\n\n\n
Restart Apache;<\/p>\n\n\n\n
systemctl restart apache2<\/code><\/pre>\n\n\n\nNext, you should be able to login to PostgreSQL 15 databases;<\/p>\n\n\n\n <\/figure>\n\n\n\nAnd that is it. You should now be able to administer your PostgreSQL server from the web interface.<\/p>\n\n\n\n
That concludes our guide on installing phpPgAdmin on Debian 12.<\/p>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n Install pgAdmin 4 on Debian 12<\/a><\/p>\n\n\n\nInstall MySQL Workbench on Oracle Linux 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"In this guide, you will learn how to install phpPgAdmin on Debian 12. phpPgAdmin is a web-based administration tool for PostgreSQL. Installing phpPgAdmin on Debian<\/p>\n","protected":false},"author":10,"featured_media":17753,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,121],"tags":[7019,7017,7020,7018,7021],"class_list":["post-17745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-howtos","tag-install-phppgadmin","tag-install-phppgadmin-on-debian-12","tag-linux-phppgadmin-install","tag-phppgadmin-install-debian","tag-postgresql-phppgadmin","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17745"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=17745"}],"version-history":[{"count":6,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17745\/revisions"}],"predecessor-version":[{"id":20822,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/17745\/revisions\/20822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/17753"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=17745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=17745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=17745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}