By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,050 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,050 IT Pros & Developers. It's quick & easy.

Tips to get GD working with PHP on *nix platforms

P: n/a
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@viha030:/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.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Patrick Saunders <ps******@comcen.com.au> wrote:
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. [...] 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).


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

Jul 17 '05 #2

P: n/a
Patrick Saunders wrote:
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@viha030:/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.

Using debian, it's simple: "apt-get install php4-gd2" ;)
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.