tags:

views:

184

answers:

3

So far, I've made sure I've installed libpng and libjpeg with DarwinPorts (I'm running on OS X Leopard), but that doesn't seem to do the trick. I've read in a number of places that you need the development files (i.e. libpng-devel, etc.) as well to make this work. I'm a little lost. Can someone help me understand what I'm supposed to do? I'm happy to provide any more information that's necessary.

My configuration for PHP looks like:

./configure '--with-png-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-gd'

and I'm trying to install PHP 5.2.9. I've gotten the make to work without the '--with-gd' option. I've also been copying what I've found on various sites, so I might be doing something really wrong.

+1  A: 

This error indicates that the libpng.so or libpng.a file could not be found. These files are created when libpng is compiled.

I don't know much about the Mac OS X way of installing things, but if you want to do it the Mac OS X way, you'll probably need to find and install that libpng-devel package.

Otherwise, you'll need to grab the source of libpng and compile it yourself. It depends on zlib, which you probably already have shared libraries for, but if not, you'll have to get that too.

Here's a guide to compiling libpng on Mac OS X. It has a darwin-specific Makefile (not sure why that's needed, but worth a try).

thomasrutter
I just tried that, I think the problem I'm having now is I just don't know where to find the libpng-devel package. I did a quick search of Fink, but I can't find it. If someone knows where I can download this, much appreciated.
Bialecki
A: 

I honestly don't know if this will do the trick, but: http://www.digitalmediaminute.com/article/2656/libpng-and-libjpg-installer-for-osx

The author says this satisfied the dependencies for their PHP config / install.

Ian Selby
A: 

I believe MacPorts installs by default to /opt/local not /usr/local? Maybe try /opt/local instead?

If you have fink, here's what I'm currently using (so i know it works)

Here are the fink packages i have installed.

 i  libpng3 1:1.2.29-1 PNG image format handling library
 i  libpng3-shlibs 1:1.2.29-1 Shared libraries for libpng3 package

 i  libjpeg 6b-17 JPEG image format handling library
 i  libjpeg-bin 6b-17 Executables for libjpeg package
 i  libjpeg-shlibs 6b-17 Shared libraries for libjpeg package

Then to configure those parts of my php I use

'--with-gd' \
'--with-jpeg-dir=/sw' \
'--with-png-dir=/sw' \
linead