[imp] compile PHP --with-imap, on OS X: progress, but...

Brent J. Nordquist bjn@horde.org
Mon, 12 Aug 2002 06:29:08 -0500 (CDT)


On Fri, 9 Aug 2002, Michael Geary <listmail@gearyweb.com> wrote:

> I am desperately trying to get PHP (4.2.2) --with-imap running on OS X,
> so I can run the IMP web-mail client.

I feel your pain.  :-)  Chuck will attest to how much time I burned at
OSCON (ultimately unsuccessfully) trying to get PHP compiled with IMAP
(everything else is working).  I can get you a little farther than you
are; the only way I found to get around this error:

> *** Warning: This library needs some functionality provided by -lc-client.
> *** I have the capability to make that library automatically link in when
> *** you link to this library.  But I can only do this if you have a
> *** shared version of the library, which you do not appear to have.

was to compile c-client as a shared library.  I hacked up the patch that
Debian uses to do this, and you can get it here:

	http://kepler.acns.bethel.edu/~bjn/imap-2001a-shlib.patch

That gets me a .so file out of the PHP build process.  Where I'm stuck is
that Apache won't load it; it can't find the IMAP library callbacks.

> I do still get a libphp4.dylib file, but when I rename this to
> libphp4.so and place it in the appropriate apache directory,

I have also learned that .dylib and .so are not the same thing; Mac OS X
is apparently different from most Unix platforms, in that a loadable
shared object and a dynamically-linked library are not the same thing.
So just renaming it won't work.

The site I found most helpful was Marc Liyanage's (I'm using his patch
also):

	http://www.entropy.ch/software/macosx/php/

I wrote to him (because his page implies that he got IMAP working); in his
response he said he didn't remember getting the error I did, and he sent
me a new version of his patch (which I haven't had time to try yet).

I hope this is a little helpful; I would love to see this all working.  I
know the PHP folks have stated that Mac OS X support will be in the next
release, but I don't know if they've tried building IMAP yet.

-- 
Brent J. Nordquist <bjn@horde.org> N0BJN
Other contact information: http://www.nordist.net/contact.html