Tips to get GD working with PHP on *nix platforms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Patrick Saunders

    #1

    Tips to get GD working with PHP on *nix platforms

    I have been trying to GD working on HPUX for about, oh 2 months now,
    and have come across something that was interesting.

    I have this configuration:
    HPUX 11
    Bundled Apache 2.0/PHP 4.3.4

    Basically, the reason GD is so hard to get to work, is that it has
    hard coded dependencies on libraries.

    I was having so many isues getting GD to work. Basically GD would
    complain that it couldn't find certain libraries, even though they are
    installed on the system.

    OK, TIP #1, Run the PHP interpreter from the command line, this is a
    great way to debug:
    EG:

    /opt/hpws/apache/php/bin/php -c php.ini test.php

    This way, you will get to see all errors that are sent to STDERR.
    I have no idea why some errors don't go into Apache log..!

    On HPUX, the ldd command lists dependencies that a ibrary has:
    Now, checkout this against GD:

    autoprod@viha03 0:/opt/phpapps> ldd
    /opt/hpws/apache/php/lib/php/extensions/gd.sl
    /usr/lib/libc.2 => /usr/lib/libc.2
    /usr/lib/libdld.2 => /usr/lib/libdld.2
    /usr/lib/libc.2 => /usr/lib/libc.2
    /usr/local/lib/libjpeg.sl => /usr/local/lib/libjpeg.sl
    /usr/local/lib/libz.sl => /usr/local/lib/libz.sl
    /usr/local/lib/libpng.sl.2 => /usr/local/lib/libpng.sl.2
    /usr/local/lib/libXpm.sl => /usr/local/lib/libXpm.sl
    /usr/local/lib/libfreetype.sl. 9 =>
    /usr/local/lib/libfreetype.sl. 9
    /usr/lib/libc.2 => /usr/lib/libc.2
    /usr/local/lib/libt1.sl.4 => /usr/local/lib/libt1.sl.4

    THIS IS THE CAUSE OF SO MANY PROBLEMS!!

    GD is staticly linked against libraries in /usr/local/lib !!

    When I even had libraries installed in /usr/local/lib/X11 it wouldn't
    find them, even with the SHLIB_PATH set (HPUX notation).

    This is just plain anoying and stupid, there must be a better way.
    I hope that this information can help someone from tearing their three
    remaining hairs out of their head..

    I can be contacted at: RAT_01 at optusnet dot com dot au
    Change RAT to PAT to send email.

    Patrick.
  • Daniel Tryba

    #2
    Re: Tips to get GD working with PHP on *nix platforms

    Patrick Saunders <psaunder@comce n.com.au> wrote:[color=blue]
    > I was having so many isues getting GD to work. Basically GD would
    > complain that it couldn't find certain libraries, even though they are
    > installed on the system.[/color]
    [...][color=blue]
    > GD is staticly linked against libraries in /usr/local/lib !!
    >
    > When I even had libraries installed in /usr/local/lib/X11 it wouldn't
    > find them, even with the SHLIB_PATH set (HPUX notation).[/color]

    Ehhh, you do know that during compilation (which is what you have
    problems with?) you not only need the libs but also the relevant
    development files (header files)?



    --

    Daniel Tryba

    Comment

    • neur0maniak

      #3
      Re: Tips to get GD working with PHP on *nix platforms

      Patrick Saunders wrote:
      [color=blue]
      > I have been trying to GD working on HPUX for about, oh 2 months now,
      > and have come across something that was interesting.
      >
      > I have this configuration:
      > HPUX 11
      > Bundled Apache 2.0/PHP 4.3.4
      >
      > Basically, the reason GD is so hard to get to work, is that it has
      > hard coded dependencies on libraries.
      >
      > I was having so many isues getting GD to work. Basically GD would
      > complain that it couldn't find certain libraries, even though they are
      > installed on the system.
      >
      > OK, TIP #1, Run the PHP interpreter from the command line, this is a
      > great way to debug:
      > EG:
      >
      > /opt/hpws/apache/php/bin/php -c php.ini test.php
      >
      > This way, you will get to see all errors that are sent to STDERR.
      > I have no idea why some errors don't go into Apache log..!
      >
      > On HPUX, the ldd command lists dependencies that a ibrary has:
      > Now, checkout this against GD:
      >
      > autoprod@viha03 0:/opt/phpapps> ldd
      > /opt/hpws/apache/php/lib/php/extensions/gd.sl
      > /usr/lib/libc.2 => /usr/lib/libc.2
      > /usr/lib/libdld.2 => /usr/lib/libdld.2
      > /usr/lib/libc.2 => /usr/lib/libc.2
      > /usr/local/lib/libjpeg.sl => /usr/local/lib/libjpeg.sl
      > /usr/local/lib/libz.sl => /usr/local/lib/libz.sl
      > /usr/local/lib/libpng.sl.2 => /usr/local/lib/libpng.sl.2
      > /usr/local/lib/libXpm.sl => /usr/local/lib/libXpm.sl
      > /usr/local/lib/libfreetype.sl. 9 =>
      > /usr/local/lib/libfreetype.sl. 9
      > /usr/lib/libc.2 => /usr/lib/libc.2
      > /usr/local/lib/libt1.sl.4 => /usr/local/lib/libt1.sl.4
      >
      > THIS IS THE CAUSE OF SO MANY PROBLEMS!!
      >
      > GD is staticly linked against libraries in /usr/local/lib !!
      >
      > When I even had libraries installed in /usr/local/lib/X11 it wouldn't
      > find them, even with the SHLIB_PATH set (HPUX notation).
      >
      > This is just plain anoying and stupid, there must be a better way.
      > I hope that this information can help someone from tearing their three
      > remaining hairs out of their head..
      >
      > I can be contacted at: RAT_01 at optusnet dot com dot au
      > Change RAT to PAT to send email.
      >
      > Patrick.[/color]
      Using debian, it's simple: "apt-get install php4-gd2" ;)

      Comment

      Working...