Install and Configure phpPgAdmin

18 Nov

Install and Configure phpPgAdmin

  • Option 1: Using Yum
    • Note that this install the latest stable version. As of this writing phpPgAdmin 4.x.
    • yum install phpPgAdmin
  • Option 2: Building from source
    • Note that this is required to build a beta package. As of this writing phpPgAdmin 5.x.
    • Download a beta package from http://phppgadmin.sourceforge.net/?page=download
    • Extract the zip file to the document root. For example: /var/www/html/phppgadmin
    • Follow the instructions in the INSTALL file in the extracted directory.
  • Setup a userid/password for phpPgAdmin
    • su – postgres
    • createuser -P pgadmin
    • Enter password for new role: xxxx
    • Enter it again: xxxx
    • Shall the new role be a superuser? (y/n) y
  • Restart Postgres
    • service postgresql-9.0 restart
  • Ensure RewriteRules allow phppgadmin requests. For example, the following Redirect rule matches redirects all request except xhprof, phpmyadmin and phppgadmin to the abc.php.

    RewriteRule !^(/phpmyadmin|/xhprof_html|/phpPgAdmin) /var/www/html/myapp/abc.php

Setup PhpPgAdmin remote access

  • If you want to access phpPgAdmin remotely ensure you set the “Allow from all” entry in /etc/httpd/conf.d/phpPgAdmin.conf

Configure PhpPgAdmin hostname

  • cd /usr/share/phpPgAdmin/conf
  • rm config.inc.php (remove the existing soft link)
  • cp config.inc.php-dist config.inc.php
  • vi config.inc.php and set the $conf.servers.host entry to the server running postgres

Edit open_basedir setting in /etc/php.ini

  • If open_basedir is set in /etc/php.ini add the following to open_basedir
    • open_basedir = /var/www/html:/usr/share/phpPgAdmin/conf:/usr/share/phpPgAdmin

Setup Export/Import tools.

  • If you want to use Export/Import features in phpMyAdmin, run the following command:
  • cp /usr/pgsql-9.0/bin/* /usr/bin
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: