Installing php 5.0.4 and postgresql 8.1.3

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
troj78
Posts: 2
Joined: 2005/06/20 18:54:24

Installing php 5.0.4 and postgresql 8.1.3

Post by troj78 » 2006/05/23 17:02:14

I have installed php 5.0.4 from the Centos Plus directory and I installed Postgresql 8.1.3 from the postgresql.org site using the rpms for 4 es. I can't get the right libpq.so file to load. The phpinfo tells me it has load ibpq 7.4.8. That is libpq.so.3. I need the libpq.so.4 that is on the system loading. Can someone tell me what might be wrong?

kremlin
Posts: 6
Joined: 2006/03/20 21:15:20
Contact:

Re: Installing php 5.0.4 and postgresql 8.1.3

Post by kremlin » 2006/06/13 01:55:55

Hi . I think I have a related problem. I tried to upgrade postgresql 7.4.x to 8.1.x using:
yum update postgre*.rpm (after i downloaded from postgresql.org as well )

I got this:

Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Examining postgresql-8.1.3-1PGDG.i686.rpm: postgresql - 8.1.3-1PGDG.i686
Examining postgresql-contrib-8.1.3-1PGDG.i686.rpm: postgresql-contrib - 8.1.3-1PGDG.i686
Examining postgresql-devel-8.1.3-1PGDG.i686.rpm: postgresql-devel - 8.1.3-1PGDG.i686
Package postgresql-devel not installed, cannot update it. Run yum install to install it instead.
Examining postgresql-docs-8.1.3-1PGDG.i686.rpm: postgresql-docs - 8.1.3-1PGDG.i686
Package postgresql-docs not installed, cannot update it. Run yum install to install it instead.
Examining postgresql-jdbc-8.1.3-1PGDG.i686.rpm: postgresql-jdbc - 8.1.3-1PGDG.i686
Examining postgresql-libs-8.1.3-1PGDG.i686.rpm: postgresql-libs - 8.1.3-1PGDG.i686
Examining postgresql-pl-8.1.3-1PGDG.i686.rpm: postgresql-pl - 8.1.3-1PGDG.i686
Examining postgresql-python-8.1.3-1PGDG.i686.rpm: postgresql-python - 8.1.3-1PGDG.i686
Examining postgresql-server-8.1.3-1PGDG.i686.rpm: postgresql-server - 8.1.3-1PGDG.i686
Examining postgresql-tcl-8.1.3-1PGDG.i686.rpm: postgresql-tcl - 8.1.3-1PGDG.i686
Examining postgresql-test-8.1.3-1PGDG.i686.rpm: postgresql-test - 8.1.3-1PGDG.i686
Package postgresql-test not installed, cannot update it. Run yum install to install it instead.
Marking postgresql-8.1.3-1PGDG.i686.rpm as an update to postgresql - 7.4.13-2.RHEL4.1.i386
Marking postgresql-contrib-8.1.3-1PGDG.i686.rpm as an update to postgresql-contrib - 7.4.13-2.RHEL4.1.i386
Marking postgresql-jdbc-8.1.3-1PGDG.i686.rpm as an update to postgresql-jdbc - 7.4.13-2.RHEL4.1.i386
Marking postgresql-libs-8.1.3-1PGDG.i686.rpm as an update to postgresql-libs - 7.4.13-2.RHEL4.1.i386
Marking postgresql-pl-8.1.3-1PGDG.i686.rpm as an update to postgresql-pl - 7.4.13-2.RHEL4.1.i386
Marking postgresql-python-8.1.3-1PGDG.i686.rpm as an update to postgresql-python - 7.4.13-2.RHEL4.1.i386
Marking postgresql-server-8.1.3-1PGDG.i686.rpm as an update to postgresql-server - 7.4.13-2.RHEL4.1.i386
Marking postgresql-tcl-8.1.3-1PGDG.i686.rpm as an update to postgresql-tcl - 7.4.13-2.RHEL4.1.i386
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package postgresql-libs.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-tcl.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-python.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-contrib.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-jdbc.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-server.i686 0:8.1.3-1PGDG set to be updated
---> Package postgresql-pl.i686 0:8.1.3-1PGDG set to be updated
--> Running transaction check
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Processing Dependency: libpq.so.3 for package: perl-DBD-Pg
--> Processing Dependency: libpq.so.3 for package: mod_auth_pgsql
--> Processing Dependency: libpq.so.3 for package: php-pgsql
--> Finished Dependency Resolution
Error: Missing Dependency: libpq.so.3 is needed by package dovecot
Error: Missing Dependency: libpq.so.3 is needed by package perl-DBD-Pg
Error: Missing Dependency: libpq.so.3 is needed by package mod_auth_pgsql
Error: Missing Dependency: libpq.so.3 is needed by package php-pgsql

Next, I checked if I have the missing dependency, libpq.so.3, and I am not sure if this is how to do it but I used:

rpm -ql postgresql-libs

##results below and shows that the libpq.so.3 exists in /usr/lib/libpq.so.3##
##

/usr/lib/libecpg.so.4
/usr/lib/libecpg.so.4.1
/usr/lib/libecpg_compat.so.1
/usr/lib/libecpg_compat.so.1.2
/usr/lib/libpgtypes.so.1
/usr/lib/libpgtypes.so.1.2
/usr/lib/libpq.so.3
/usr/lib/libpq.so.3.1
/usr/share/locale/cs/LC_MESSAGES/libpq.mo
/usr/share/locale/de/LC_MESSAGES/libpq.mo
/usr/share/locale/es/LC_MESSAGES/libpq.mo
/usr/share/locale/fr/LC_MESSAGES/libpq.mo
/usr/share/locale/hr/LC_MESSAGES/libpq.mo
/usr/share/locale/it/LC_MESSAGES/libpq.mo
/usr/share/locale/nb/LC_MESSAGES/libpq.mo
/usr/share/locale/pt_BR/LC_MESSAGES/libpq.mo
/usr/share/locale/ru/LC_MESSAGES/libpq.mo
/usr/share/locale/sl/LC_MESSAGES/libpq.mo
/usr/share/locale/sv/LC_MESSAGES/libpq.mo
/usr/share/locale/tr/LC_MESSAGES/libpq.mo
/usr/share/locale/zh_CN/LC_MESSAGES/libpq.mo
/usr/share/locale/zh_TW/LC_MESSAGES/libpq.mo

Any advice on what to do next would be greatly appreciated. Btw, the 7.4 version with php 4.3.9 works! but obviously would like to upgrade.
Thanks all in advance helping the newbies.
Emile :-?

kremlin
Posts: 6
Joined: 2006/03/20 21:15:20
Contact:

Re: Installing php 5.0.4 and postgresql 8.1.3

Post by kremlin » 2006/06/13 12:10:21

A possible workaround that at least allowed me to get rid of the dependency complaint by lib.so.3 and how to get postgresql 8.1.3 up and running.

### How to remove the old 7.4 postgresql, install 813 and then create
### templates, then create a movie database.
### Assume you already downloaded the 8.1.3 rpm's to a foldder called 'postgre813'
### I am using version 4.3.x of centos with 4.3.9php (not yet upgraded)
### These notes only describe my workaround for gettin postgresql8.1.3 to work
### Warning: I am a newbie so this may not be the best way to do things! Glad to get expert comments.

### First, Get rid of painful lib.so.3 dependency.

[root@kayak postgre813]# yum remove postgresql-libs
Setting up Remove Process
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package postgresql-libs.i386 0:7.4.13-2.RHEL4.1 set to be erased
--> Running transaction check
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
--> Processing Dependency: libpq.so for package: postgresql-python
--> Processing Dependency: libpq.so.3 for package: postgresql-tcl
--> Processing Dependency: libpq.so.3 for package: perl-DBD-Pg
--> Processing Dependency: libpq.so.3 for package: postgresql
--> Processing Dependency: libpq.so.3 for package: postgresql-python
--> Processing Dependency: libpq.so for package: postgresql-tcl
--> Processing Dependency: libpq.so for package: postgresql-server
--> Processing Dependency: libpq.so.3 for package: mod_auth_pgsql
--> Processing Dependency: postgresql-libs >= 7.3 for package: postgresql-odbc
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Processing Dependency: libpq.so.3 for package: postgresql-contrib
--> Processing Dependency: libpq.so.3 for package: postgresql-server
--> Processing Dependency: libpq.so.3 for package: php-pgsql
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package postgresql-server.i386 0:7.4.13-2.RHEL4.1 set to be erased
---> Package postgresql-python.i386 0:7.4.13-2.RHEL4.1 set to be erased
---> Package dovecot.i386 0:0.99.11-2.EL4.1 set to be erased
---> Package mod_auth_pgsql.i386 0:2.0.1-7.1 set to be erased
---> Package postgresql.i386 0:7.4.13-2.RHEL4.1 set to be erased
---> Package postgresql-odbc.i386 0:7.3-8.RHEL4.1 set to be erased
---> Package php-pgsql.i386 0:4.3.9-3.12 set to be erased
---> Package postgresql-tcl.i386 0:7.4.13-2.RHEL4.1 set to be erased
---> Package postgresql-contrib.i386 0:7.4.13-2.RHEL4.1 set to be erased
---> Package perl-DBD-Pg.i386 0:1.31-6 set to be erased
--> Running transaction check
--> Processing Dependency: php-pgsql >= 4.2 for package: phpPgAdmin
--> Processing Dependency: postgresql-server = 7.4.13-2.RHEL4.1 for package: postgresql-pl
--> Processing Dependency: postgresql = 7.4.13-2.RHEL4.1 for package: postgresql-pl
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Package phpPgAdmin.noarch 0:4.0.1-1 set to be erased
---> Package postgresql-pl.i386 0:7.4.13-2.RHEL4.1 set to be erased
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Removing:
postgresql-libs i386 7.4.13-2.RHEL4.1 installed 372 k
Removing for dependencies:
dovecot i386 0.99.11-2.EL4.1 installed 1.4 M
mod_auth_pgsql i386 2.0.1-7.1 installed 53 k
perl-DBD-Pg i386 1.31-6 installed 166 k
php-pgsql i386 4.3.9-3.12 installed 80 k
phpPgAdmin noarch 4.0.1-1 installed 3.2 M
postgresql i386 7.4.13-2.RHEL4.1 installed 7.7 M
postgresql-contrib i386 7.4.13-2.RHEL4.1 installed 1.1 M
postgresql-odbc i386 7.3-8.RHEL4.1 installed 280 k
postgresql-pl i386 7.4.13-2.RHEL4.1 installed 113 k
postgresql-python i386 7.4.13-2.RHEL4.1 installed 146 k
postgresql-server i386 7.4.13-2.RHEL4.1 installed 7.5 M
postgresql-tcl i386 7.4.13-2.RHEL4.1 installed 35 k

Transaction Summary
=============================================================================
Install 0 Package(s)
Update 0 Package(s)
Remove 13 Package(s)
Total download size: 0
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Removing : php-pgsql ####################### [ 1/13]
Removing : postgresql-server ####################### [ 2/13]
Removing : postgresql-python ####################### [ 3/13]
Removing : dovecot ####################### [ 4/13]
Removing : mod_auth_pgsql ####################### [ 5/13]
Removing : postgresql ####################### [ 6/13]
Removing : postgresql-odbc ####################### [ 7/13]
Removing : postgresql-tcl ####################### [ 8/13]
Removing : phpPgAdmin ####################### [ 9/13]
Removing : postgresql-pl ####################### [10/13]
Removing : postgresql-contrib ####################### [11/13]
Removing : perl-DBD-Pg ####################### [12/13]
Removing : postgresql-libs ####################### [13/13]

Removed: postgresql-libs.i386 0:7.4.13-2.RHEL4.1
Dependency Removed: dovecot.i386 0:0.99.11-2.EL4.1 mod_auth_pgsql.i386 0:2.0.1-7.1 perl-DBD-Pg.i386 0:1.31-6 php-pgsql.i386 0:4.3.9-3.12 phpPgAdmin.noarch 0:4.0.1-1 postgresql.i386 0:7.4.13-2.RHEL4.1 postgresql-contrib.i386 0:7.4.13-2.RHEL4.1 postgresql-odbc.i386 0:7.3-8.RHEL4.1 postgresql-pl.i386 0:7.4.13-2.RHEL4.1 postgresql-python.i386 0:7.4.13-2.RHEL4.1 postgresql-server.i386 0:7.4.13-2.RHEL4.1 postgresql-tcl.i386 0:7.4.13-2.RHEL4.1
Complete!
[root@kayak postgre813]#

################################################################
#### now just install postgresql813 from downloaded rpm's using:
#################################################################

[root@kayak postgre813]# rpm -ihv *.rpm


warning: postgresql-8.1.3-1PGDG.i686.rpm: V3 DSA signature: NOKEY, key ID 748f7d0e
Preparing... ########################################### [100%]
1:postgresql-libs ########################################### [ 9%]
2:postgresql ########################################### [ 18%]
3:postgresql-server ########################################### [ 27%]
4:postgresql-contrib ########################################### [ 36%]
5:postgresql-devel ########################################### [ 45%]
6:postgresql-docs ########################################### [ 55%]
7:postgresql-jdbc ########################################### [ 64%]
8:postgresql-pl ########################################### [ 73%]
9:postgresql-python ########################################### [ 82%]
10:postgresql-tcl ########################################### [ 91%]
11:postgresql-test ########################################### [100%]
[root@kayak postgre813]#
[root@kayak postgre813]#

### check the new lib versions with:
[root@kayak postgre813]# rpm -ql postgresql-libs
/usr/lib/libecpg.so.5
/usr/lib/libecpg.so.5.1
/usr/lib/libecpg_compat.so.2
/usr/lib/libecpg_compat.so.2.1
/usr/lib/libpgtypes.so.2
/usr/lib/libpgtypes.so.2.1
/usr/lib/libpq.so.4
/usr/lib/libpq.so.4.1
/usr/share/locale/af/LC_MESSAGES/libpq.mo
/usr/share/locale/cs/LC_MESSAGES/libpq.mo
/usr/share/locale/de/LC_MESSAGES/libpq.mo
/usr/share/locale/es/LC_MESSAGES/libpq.mo
/usr/share/locale/fr/LC_MESSAGES/libpq.mo
/usr/share/locale/hr/LC_MESSAGES/libpq.mo
/usr/share/locale/it/LC_MESSAGES/libpq.mo
/usr/share/locale/ko/LC_MESSAGES/libpq.mo
/usr/share/locale/nb/LC_MESSAGES/libpq.mo
/usr/share/locale/pl/LC_MESSAGES/libpq.mo
/usr/share/locale/pt_BR/LC_MESSAGES/libpq.mo
/usr/share/locale/ru/LC_MESSAGES/libpq.mo
/usr/share/locale/sk/LC_MESSAGES/libpq.mo
/usr/share/locale/sl/LC_MESSAGES/libpq.mo
/usr/share/locale/sv/LC_MESSAGES/libpq.mo
/usr/share/locale/tr/LC_MESSAGES/libpq.mo
/usr/share/locale/zh_CN/LC_MESSAGES/libpq.mo
/usr/share/locale/zh_TW/LC_MESSAGES/libpq.mo
[root@kayak postgre813]#

## next, switch to the postgres superuser
##################################

[root@kayak postgre813]# su - postgres
-bash-3.00$ echo $PGDATA
/var/lib/pgsql/data
-bash-3.00$ initdb
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.

initdb: directory "/var/lib/pgsql/data" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/var/lib/pgsql/data" or run initdb
with an argument other than "/var/lib/pgsql/data".
-bash-3.00$

##now delete all files in /var/lib/pgsql/data and do initdb again.
####################################################################################
## get rid of the old template databases. careful with -rf command.....you could erase your disk if run in /
## rm -rf directoryname under /var/lib/pgsql/data
## like this:
[root@kayak data]# rm -rf base
[root@kayak data]# rm -rf global
[root@kayak data]# rm -rf pg_clog
[root@kayak data]# rm -rf PG_VERSION
[root@kayak data]# rm -rf pg_xlog

## now become postgres user again to create the new template db's

[root@kayak data]# su - postgres
-bash-3.00$ echo $PGDATA

/var/lib/pgsql/data

## initialise a database
-bash-3.00$ initdb
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.

fixing permissions on existing directory /var/lib/pgsql/data ... ok
creating directory /var/lib/pgsql/data/global ... ok
creating directory /var/lib/pgsql/data/pg_xlog ... ok
creating directory /var/lib/pgsql/data/pg_xlog/archive_status ... ok
creating directory /var/lib/pgsql/data/pg_clog ... ok
creating directory /var/lib/pgsql/data/pg_subtrans ... ok
creating directory /var/lib/pgsql/data/pg_twophase ... ok
creating directory /var/lib/pgsql/data/pg_multixact/members ... ok
creating directory /var/lib/pgsql/data/pg_multixact/offsets ... ok
creating directory /var/lib/pgsql/data/base ... ok
creating directory /var/lib/pgsql/data/base/1 ... ok
creating directory /var/lib/pgsql/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
enabling unlimited row size for system tables ... ok
initializing dependencies ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

postmaster -D /var/lib/pgsql/data
or
pg_ctl -D /var/lib/pgsql/data -l logfile start

-bash-3.00$

### start the postmaster like this ########
pg_ctl -D /var/lib/pgsql/data -l logfile start

postmaster starting
-bash-3.00$
-bash-3.00$


### now createdb movies like this ####you could called the database whatever you want. It will be built based on the templates.
createdb movies

-bash-3.00$ createdb movies
CREATE DATABASE


### now createuser bruce as follows:
-bash-3.00$ createuser bruce
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y
CREATE ROLE
-bash-3.00$


## now connect to the movies database using psql -d movies
-bash-3.00$ psql -d movies
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

movies=#


## Congratulations! you can follow above options or \q to quit the movie database!
### Any expert comments welcome.

Kremlin

Post Reply

Return to “CentOS 4 - Server Support”