Nov/0711
Install phpPgAdmin on Ubuntu 7.10
Update: These instructions have been tested and work fine in the latest version of Ubuntu (8.04, Hardy Heron).
phpPgAdmin is a web based GUI for administrating a PostgreSQL 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 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 following2…
$ 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 all should be ready for you.
-
I am assuming here that you have set-up your PostgreSQL server using my set-up instructions and therefore have a password protected ‘postgres’ account and that logins require passwords. ↩
-
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! ↩












10:10 am on December 21st, 2007
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 reload10:33 am on December 21st, 2007
Great 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.
4:01 pm on December 21st, 2007
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!
12:38 pm on March 3rd, 2008
GREAT MANUAL!
2:34 pm on April 7th, 2008
su -c 'createuser -P admin' postgres Enter 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
12:49 am on April 10th, 2008
That should be installed already - it’s a dependency of phppgadmin.
For more info on account creation, see here.
12:03 am on June 12th, 2008
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).
1:09 am on June 14th, 2008
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.conffile 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.
1:17 pm on October 19th, 2008
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
7:19 pm on November 9th, 2008
Great manual! Thanks a lot, I’m a newbie in posgresql.