Compile/Linking problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrice Lazareff

    Compile/Linking problem

    Hello,

    So it seems that there still is an incompatibility between GD and
    libpng-1.2.x... fine

    So I installed into a dedicated directory an older version, 1.0.15

    In my configure line I inserted
    --with-png-dir=/my/old-libpng/path

    Everything goes fine, and all once built

    [patrice@localho st php-5.0.0b1]$ ldd sapi/cli/php|grep png
    libpng.so.2 => /usr/lib/./libpng.so.2 (0x40350000)

    The command line php is indeed linked against the "old" libpng and all works
    like a charm, but...

    [patrice@localho st php-5.0.0b1]$ ldd libs/libphp5.so |grep png
    libpng.so.3 => /usr/lib/libpng.so.3 (0x403bc000)

    The Apache module (--with-apxs) is linked against my system libpng, so any
    script that calls ImageCreateFrom Png() causes apache to SegFault :-(((

    How do I tell apxs to link according to the configure script ???

    Thanks,
    Patrice

    P.S: This is not related to the beta status of PHP5, older stable versions
    behave in the same way.
    --
    Posté avec Knode, le lecteur de niouzes de KDE
  • matty

    #2
    Re: Compile/Linking problem

    Patrice Lazareff wrote:
    [color=blue]
    >
    > So it seems that there still is an incompatibility between GD and
    > libpng-1.2.x... fine
    >
    > So I installed into a dedicated directory an older version, 1.0.15
    >
    > In my configure line I inserted
    > --with-png-dir=/my/old-libpng/path
    >
    > Everything goes fine, and all once built
    >
    > [patrice@localho st php-5.0.0b1]$ ldd sapi/cli/php|grep png
    > libpng.so.2 => /usr/lib/./libpng.so.2 (0x40350000)
    >
    > The command line php is indeed linked against the "old" libpng and all
    > works like a charm, but...
    >
    > [patrice@localho st php-5.0.0b1]$ ldd libs/libphp5.so |grep png
    > libpng.so.3 => /usr/lib/libpng.so.3 (0x403bc000)
    >
    > The Apache module (--with-apxs) is linked against my system libpng, so any
    > script that calls ImageCreateFrom Png() causes apache to SegFault :-(((
    >
    > How do I tell apxs to link according to the configure script ???
    >[/color]

    Assuming
    1 - you have an "old" and "new" libpng present on your server
    2 - the "old" libpng is in a non-standard place that ldconfig doesn't know about
    3 - the "new" libpng *is* in a standard location

    Then you will have problems doing this. The thing to do, is to remove
    the new libpng, install the "old" one in a suitable location/prefix,
    and then rebuild php that way

    Unless I've misunderstood what you've been doing!

    Matt

    Comment

    • Patrice Lazareff

      #3
      Re: Compile/Linking problem

      Hi Matt,

      Thanks for the input, you do assume well :-)

      The one thing is that the server in question is my own development laptop, a
      Sony Vaio running what once was a RedHat 7, heavily modified since and now
      almost a LinuxFromScratc h sort of thinggy... (never got used to rpm ;-)

      IOW, downgrading libpng would mean recompiling all my KDE apps, which is
      somewhat loooonnnng.

      So I finally managed my way with a very dirty trick involving cut'n paste
      from the right portion from the compile output (where the line ends by -o
      ..libs/libphp5.so) and removing all the -lpng and adding
      /my/non-standard/libpng/path/lib/libpng.so

      This relinks libphp5.so and puts it into .libs/

      A simple su -c 'make install' later and you now what, it finally works and I
      am quite happy to say the least...

      So now, I can resume trying to setup the OpenSource CMS Typo3
      (typo3.com|org) which made me discover my config flaw (broken
      ImageCreateFrom Png())

      Okay now, enough keywords for groups.google.c om ;-)

      Thanks again, cheers,

      Patrice

      Matt wrote:
      [color=blue]
      > Assuming
      > 1 - you have an "old" and "new" libpng present on your server
      > 2 - the "old" libpng is in a non-standard place that ldconfig doesn't know
      > about 3 - the "new" libpng *is* in a standard location
      >
      > Then you will have problems doing this. The thing to do, is to remove
      > the new libpng, install the "old" one in a suitable location/prefix,
      > and then rebuild php that way
      >
      > Unless I've misunderstood what you've been doing!
      >
      > Matt[/color]

      --
      Posté avec Knode, le lecteur de niouzes de KDE

      Comment

      Working...