Update: These instructions have been tested and work fine in the latest version of Ubuntu (8.04, Hardy Heron).
[phpPgAdmin](http://www.phppgadmin.org/) is a web based GUI for administrating a [PostgreSQL](http://www.postgresql.org/) database server.
Here’s some quick notes on getting it installed easily on Ubuntu 7.10…
In the terminal enter the following:
$ sudo apt-get install phppgadmin
This will set up and install all of the phpPgAdmin packages. It will also set-up and configure Apache and php5 for you too if you haven’t installed these already.
Next we need to create a symlink to phpPgAdmin so that Apache can find it:
$ sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.conf
Now if you navigate to [http://localhost/phppgadmin](http://localhost/phppgadmin) you should be greeted with the phpPgAdmin screen. If your user account has a PostgreSQL account however, you will be logged in automagically.
Optionally, if you would like to be able to use the phpPgAdmin interface as the default ‘postgres’ administration account,[^1] you will need to do the following[^2]…
$ sudo gedit /usr/share/phppgadmin/conf/config.inc.php
Now find and change the following line
$conf[‘extra_login_security’] = true;
to
$conf[‘extra_login_security’] = false;
Save and close gedit. Now all you need to do is restart Apache.
$ sudo /etc/init.d/apache2 reload
Now if you head on over to [http://localhost/phppgadmin](http://localhost/phppgadmin) all should be ready for you.
[^1]: I am assuming here that you have set-up your PostgreSQL server using my [set-up instructions](/2007/11/05/install-posgresql-on-ubuntu-710/) and therefore have a password protected ‘postgres’ account and that logins require passwords.
[^2]: Please make sure you have read the above footnote and understand the security implications of allowing this type of access to your database server - if you have not secured your administration accounts, do it now!
Hi,
Thanks for the info.
I found another symlink was needed on my 7.10 install.
I also needed:
$ sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.confso that apache would read in the phppgadmin configuration.
Another apache reload read the config after the symlink was created.
# /etc/init.d/apache2 reloadGreat tip, thanks! This also has the added benefit of working nicely with virtual hosts (as the original setup would barf if you started to use virtual hosts).
Will add this to the above.
Heya,
I followed your instructions but I cannot login on phppgadmin, not with postgres, not with my account. Do you have any hints on how I can debug this? Thanks!
GREAT MANUAL!
su -c 'createuser -P admin' postgresEnter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) y
CREATE ROLE
You need of course, php5-pgsql
That should be installed already - it’s a dependency of phppgadmin.
For more info on account creation, see here.
Hi, I’m trying to do this now on Hardy and having a problem. I’m new to all this so there’s a fine chance I’ve stuffed it up.
This is what’s happening:
sudo /etc/init.d/apache2 reload
apache2: Syntax error on line 295 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/phppgadmin.conf: No such file or directory
…fail!
When I freshly install phppgadmin the only file inside /etc/phppgadmin/ is config.inc.php — there is no apache.conf.
I’ve set up postgres with your most recent tutorial.
Some guidance will be much appreciated! Thanks.
Also, it’s a Slicehost box which has been set up with their various instructions (starting at the very beginning with http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1).
Hi Dylan, this sounds quite strange… Let’s check a couple of things…
Wierd… Okay, try installing again (you did install via `apt-get`?), if you don’t get the `/etc/phppgadmin/apache.conf` file this time, here’s a copy of the one off my install - create the file yourself and paste this into it:
Finally, delete and re-create the symlink, fingers crossed this should kick things into life for you:
Let me know how you get on.
i have have followed ur steps and able to install phppgadmin and apache2. however i cannot access http://localhost/. can anyone explain me why?
thanks
Great manual! Thanks a lot, I’m a newbie in posgresql.
Thank you very much, simple and easy guide! Helped me a lot!
This works on 9.10 as well with the only exception is that 9.10 automatically creates the symlink for you.