Knowledgebase

Perfectly Enabling PosgreSQL and phpPgAdmin in CWP

PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, and among others.

 

phpPgAdmin is a web-based administration tool for PostgreSQL. It is perfect for PostgreSQL DBAs, newbies, and hosting services.

 

Features:

 

Administer multiple servers
Support for PostgreSQL 8.4.x, 9.0.x, 9.1.x, 9.2.x
Manage all aspects of:
Users & groups
Databases
Schemas
Tables, indexes, constraints, triggers, rules & privileges
Views, sequences & functions
Advanced objects
Reports
Easy data manipulation:
Browse tables, views & reports
Execute arbitrary SQL
Select, insert, update and delete
Dump table data in a variety of formats: SQL, COPY, XML, XHTML, CSV, Tabbed, pg_dump
Import SQL scripts, COPY data, XML, CSV and Tabbed
Supports the Slony master-slave replication engine
Excellent language support:
Available in 27 languages
No encoding conflicts. Edit Russian data using a Japanese interface!
Easy to install and configure

 

Let start with Installation and Configuration.

 

1) Login in CWP (http://yourip.com:2030)

 

2) Navigate to SQL Services --> PostgreSQL and click on Click to Install PostgreSQL

 

 

3) Restart Apache.

service httpd restart

 

4) Login to phpPgAdmin (http://yourip/phpPgAdmin/)

 

If you get below error then we need to recompile php with --with-pgsql

"Your PHP installation does not support PostgreSQL. You need to recompile PHP using the --with-pgsql configure option."

 

a) Navigate to PHP Settings --> PHP Version Switcher.

 

b) Select PHP version and click Next>.

 

c) Add --with-pgsql in Additional configuration (only for advanced users):

 

Once compiling is completed Proceed with step 4 again. If Everything done right you will see page like below

 

Configure PostgreSQL and phpPgAdmin

 

1) Login to ssh (Using putty)

 

2) Setup Postgres Password.

sudo -u postgres psql postgres
\password postgres

Enter your password , confirm it again and exit (\q)

 

3) Edit phpPgAdmin config file to allow login.

nano /usr/local/apache/htdocs/phpPgAdmin/conf/config.inc.php

Find $conf['extra_login_security'] = true; and change it to false.

 

Everything is setup and good to go. Login to phpPgAdmin (http://yourip/phpPgAdmin/) with username: postgres and password: you-know-it-better.

  • 9 Users Found This Useful
Was this answer helpful?