Thread: library version problem, 7.3.2, php, redhat linux

library version problem, 7.3.2, php, redhat linux

From
Richard Welty
Date:
ok, i'm confused.

i have two systems. one is redhat 7.1 (a server in colo, reasonably
current), the other is 8.0 (my laptop). the server in colo is running
postgresql 7.3.2 along with redhat's updated versions of apache and php for
7.1 (the php version is 4.1.2) on this server, php can access postgres
without difficulty.

my laptop is also running 7.3.2 along with the apache and php that go with
RH 8.0. i found a need to bring up apache so i could test some php against
postgresql, and was suprised to find that is failing (it'd been a while
since i'd run the web server on this system). reviewing
/var/log/httpd/error_log showed the following:

[Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
 - libpq.so.2: cannot open shared object file: No such file or directory
in Unknown on line 0

this seems to clearly be a library versioning problem, as
"ls -l /usr/lib/libpq*" gives me

-rw-r--r--  1 root root  113800 Feb  5  2003 /usr/lib/libpq.a
lrwxrwxrwx  1 root root      12 Jun 26 14:19 /usr/lib/libpq.so -> libpq.so.3.0
lrwxrwxrwx  1 root root      12 Aug  1 08:09 /usr/lib/libpq.so.3 -> libpq.so.3.0
-rwxr-xr-x  1 root root  552967 Jul 28 18:30 /usr/lib/libpq.so.3.0
[root@skipper lib]#

i remember having problems with libpq.so.2 disappearing when i installed
7.3.2, and i had to recompile the exim MTA because i have it using
postgresql, but i don't remember php having these issues.

so why would php->postgresql access be working on the 7.1 system but not
the 8.0 system?

thanks,
  richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security

Re: library version problem, 7.3.2, php, redhat linux

From
"Nigel J. Andrews"
Date:
On Thu, 11 Sep 2003, Richard Welty wrote:

> ok, i'm confused.
>
> i have two systems. one is redhat 7.1 (a server in colo, reasonably
> current), the other is 8.0 (my laptop). the server in colo is running
> postgresql 7.3.2 along with redhat's updated versions of apache and php for
> 7.1 (the php version is 4.1.2) on this server, php can access postgres
> without difficulty.
>
> my laptop is also running 7.3.2 along with the apache and php that go with
> RH 8.0. i found a need to bring up apache so i could test some php against
> postgresql, and was suprised to find that is failing (it'd been a while
> since i'd run the web server on this system). reviewing
> /var/log/httpd/error_log showed the following:
>
> [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
> PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
>  - libpq.so.2: cannot open shared object file: No such file or directory
> in Unknown on line 0
>
> this seems to clearly be a library versioning problem, as
> "ls -l /usr/lib/libpq*" gives me
>
> -rw-r--r--  1 root root  113800 Feb  5  2003 /usr/lib/libpq.a
> lrwxrwxrwx  1 root root      12 Jun 26 14:19 /usr/lib/libpq.so -> libpq.so.3.0
> lrwxrwxrwx  1 root root      12 Aug  1 08:09 /usr/lib/libpq.so.3 -> libpq.so.3.0
> -rwxr-xr-x  1 root root  552967 Jul 28 18:30 /usr/lib/libpq.so.3.0
> [root@skipper lib]#

Well not quite. The complaint is that the PHP interface to PostgreSQL isn't
found. As for why it can't be found I can't really help. Could be PHP
configure/build, could be it wasn't installed. A little surprising perhaps but
then I know next to nothing about Redhat installations.


--
Nigel J. Andrews


Re: library version problem, 7.3.2, php, redhat linux

From
Oliver Elphick
Date:
On Fri, 2003-09-12 at 07:21, Nigel J. Andrews wrote:
> On Thu, 11 Sep 2003, Richard Welty wrote:
...
> > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
> > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
> >  - libpq.so.2: cannot open shared object file: No such file or directory
> > in Unknown on line 0
> >
> > this seems to clearly be a library versioning problem, as
> > "ls -l /usr/lib/libpq*" gives me
> >
> > -rw-r--r--  1 root root  113800 Feb  5  2003 /usr/lib/libpq.a
> > lrwxrwxrwx  1 root root      12 Jun 26 14:19 /usr/lib/libpq.so -> libpq.so.3.0
> > lrwxrwxrwx  1 root root      12 Aug  1 08:09 /usr/lib/libpq.so.3 -> libpq.so.3.0
> > -rwxr-xr-x  1 root root  552967 Jul 28 18:30 /usr/lib/libpq.so.3.0
> > [root@skipper lib]#
>
> Well not quite. The complaint is that the PHP interface to PostgreSQL isn't
> found.

If I understand the error message correctly, it looks as though
/usr/lib/php4/pgsql.so is linked to libpq.so.2, which does not exist.
You need a version of php built against a more recent postgresql.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Let the wicked forsake his way, and the unrighteous
      man his thoughts; and let him return unto the LORD,
      and He will have mercy upon him; and to our God, for
      he will abundantly pardon."          Isaiah 55:7


Re: library version problem, 7.3.2, php, redhat linux

From
"Nigel J. Andrews"
Date:
On Fri, 12 Sep 2003, Oliver Elphick wrote:

> On Fri, 2003-09-12 at 07:21, Nigel J. Andrews wrote:
> > On Thu, 11 Sep 2003, Richard Welty wrote:
> ...
> > > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
> > > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
> > >  - libpq.so.2: cannot open shared object file: No such file or directory
> > > in Unknown on line 0
> >
> > Well not quite. The complaint is that the PHP interface to PostgreSQL isn't
> > found.
>
> If I understand the error message correctly, it looks as though
> /usr/lib/php4/pgsql.so is linked to libpq.so.2, which does not exist.
> You need a version of php built against a more recent postgresql.

Doh! Trust me to not read the original message properly.

Still I'd point to my PHP build/configure comment if you'd left that in the
quoted the matterial :)

It does look like PHP needs rebuilding so that it uses the right postgresql
library. However, isn't this supposed to be a plain install of Redhat,
i.e. installed from RPMs with nothing upgraded to versions outside of the
original distribution so everything matches?


--
Nigel J. Andrews


Re: library version problem, 7.3.2, php, redhat linux

From
Richard Huxton
Date:
On Friday 12 September 2003 11:03, Nigel J. Andrews wrote:
> On Fri, 12 Sep 2003, Oliver Elphick wrote:
> > On Fri, 2003-09-12 at 07:21, Nigel J. Andrews wrote:
> > If I understand the error message correctly, it looks as though
> > /usr/lib/php4/pgsql.so is linked to libpq.so.2, which does not exist.
> > You need a version of php built against a more recent postgresql.
>
> Doh! Trust me to not read the original message properly.
>
> Still I'd point to my PHP build/configure comment if you'd left that in the
> quoted the matterial :)
>
> It does look like PHP needs rebuilding so that it uses the right postgresql
> library. However, isn't this supposed to be a plain install of Redhat,
> i.e. installed from RPMs with nothing upgraded to versions outside of the
> original distribution so everything matches?

RedHat 9 ships with a package called: postgresql72-libs-1-3.i386.rpm
It might be that hasn't been picked up as a dependency.

--
  Richard Huxton
  Archonet Ltd

Re: library version problem, 7.3.2, php, redhat linux

From
Richard Welty
Date:
On Fri, 12 Sep 2003 07:21:19 +0100 (BST) "Nigel J. Andrews" <nandrews@investsystems.co.uk> wrote:

> On Thu, 11 Sep 2003, Richard Welty wrote:
>
> > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
> > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
> >  - libpq.so.2: cannot open shared object file: No such file or
> directory
> > in Unknown on line 0
>
> > this seems to clearly be a library versioning problem, as
> > "ls -l /usr/lib/libpq*" gives me

> > -rw-r--r--  1 root root  113800 Feb  5  2003 /usr/lib/libpq.a
> > lrwxrwxrwx  1 root root      12 Jun 26 14:19 /usr/lib/libpq.so ->
> libpq.so.3.0
> > lrwxrwxrwx  1 root root      12 Aug  1 08:09 /usr/lib/libpq.so.3 ->
> libpq.so.3.0
> > -rwxr-xr-x  1 root root  552967 Jul 28 18:30 /usr/lib/libpq.so.3.0
> > [root@skipper lib]#

> Well not quite. The complaint is that the PHP interface to PostgreSQL
> isn't
> found.

i don't think so.

/usr/lib/php4/pqsql.so is there, and is generating the message. pqsql.so is
complaining that it can't find /usr/lib/libpq.so.2

if you look at the ls -l, you clearly see that /usr/lib/libpq.so.2 is not
there. this change in library versions happened when i upgraded to 7.3.2, i
had to recompile some stuff, but on the 7.1 machine i didn't have to make
any changes to php, and on the 8.0 machine, clearly there's an issue. since
in installing 7.3.2 i stepped out of the normal rh release cycle, it's not
obvious how to go forward from here.


richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security

Re: library version problem, 7.3.2, php, redhat linux

From
Robert Treat
Date:
On Fri, 2003-09-12 at 08:06, Richard Welty wrote:
> On Fri, 12 Sep 2003 07:21:19 +0100 (BST) "Nigel J. Andrews" <nandrews@investsystems.co.uk> wrote:
>
> > On Thu, 11 Sep 2003, Richard Welty wrote:
> >
> > > [Thu Sep 11 16:17:25 2003] [notice] caught SIGTERM, shutting down
> > > PHP Warning:  Unable to load dynamic library '/usr/lib/php4/pgsql.so'
> > >  - libpq.so.2: cannot open shared object file: No such file or
> > directory
> > > in Unknown on line 0
> >
> > > this seems to clearly be a library versioning problem, as
> > > "ls -l /usr/lib/libpq*" gives me
>
> > > -rw-r--r--  1 root root  113800 Feb  5  2003 /usr/lib/libpq.a
> > > lrwxrwxrwx  1 root root      12 Jun 26 14:19 /usr/lib/libpq.so ->
> > libpq.so.3.0
> > > lrwxrwxrwx  1 root root      12 Aug  1 08:09 /usr/lib/libpq.so.3 ->
> > libpq.so.3.0
> > > -rwxr-xr-x  1 root root  552967 Jul 28 18:30 /usr/lib/libpq.so.3.0
> > > [root@skipper lib]#
>
> > Well not quite. The complaint is that the PHP interface to PostgreSQL
> > isn't
> > found.
>
> i don't think so.
>
> /usr/lib/php4/pqsql.so is there, and is generating the message. pqsql.so is
> complaining that it can't find /usr/lib/libpq.so.2
>

correct. libpq comes from postgresql, not php

> if you look at the ls -l, you clearly see that /usr/lib/libpq.so.2 is not
> there. this change in library versions happened when i upgraded to 7.3.2, i
> had to recompile some stuff, but on the 7.1 machine i didn't have to make
> any changes to php, and on the 8.0 machine, clearly there's an issue. since
> in installing 7.3.2 i stepped out of the normal rh release cycle, it's not
> obvious how to go forward from here.

chances are on your colo box they installed 7.2 at some point which gave
you libpq.so.2 (or someone symlinked the 2 files so as to hack there way
out of this problem).  i think your choices now are to install 7.2
pgsql-libs rpm on the 8.0 box or to recompile apache/php so it links
against libpq.so.3

Robert Treat

--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


Re: library version problem, 7.3.2, php, redhat linux

From
Richard Welty
Date:
On 12 Sep 2003 12:11:59 -0400 Robert Treat <xzilla@users.sourceforge.net> wrote:

> chances are on your colo box they installed 7.2 at some point which gave
> you libpq.so.2 (or someone symlinked the 2 files so as to hack there way
> out of this problem).

no and no.

i'm the only admin the colo box has ever had, and it is solidly still at rh
7.1.

i never symlinked libpq.so.2 at any point in time. when i upgraded
postgres, i observed my exim install failing, so i rebuilt that. i never
saw any other problems related to the library version change on the 7.1
box.

>  i think your choices now are to install 7.2
> pgsql-libs rpm on the 8.0 box

where the question is this -- given that the box is running 7.3.2
successfully and needs to be running 7.3.x (that is, i won't downgrade it),
will installing 7.2 pgsql-libs break stuff?

> or to recompile apache/php so it links
> against libpq.so.3

oh joy. time to download the source rpms. glad i'm not in a hurry.

richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
    Java, PHP, PostgreSQL, Unix, Linux, IP Network Engineering, Security