Upgrading Mac Libraries
Does anyone know how to upgrade open source libraries bundled with Mac OS X? My specific concern is with the version of libxml installed on this server (2.6.16) which has serious bugs in RELAX NG validation. I want to upgrade that to version 2.6.26.
I do not want to simply add a new version of the library somewhere else. At a minimum I need a library PHP can find. Currently that’s in /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/libxml2.dylib and this is the file I need to replace. How do I create that file from the usual PHP sources? Or alternately how do I tell PHP to use a version of libxml from a different location?
November 29th, 2006 at 10:14 PM
I’ve been advised from some people I trust that you should not replace the library in the sdk directory.
Out of curiousity, I just did a PHP 5.2.0 for Apache 1.3 install using Marc Liyanage’s installer… I noticed that my phpinfo() page claims that php is using a libxml2 located in: /usr/local/php5/. And the latest libxml2 (2.2.6.26) is indeed installed under lib there. I would guess php is using this. My php.ini file seems to be silent on the issue…
November 30th, 2006 at 6:20 AM
I just installed PHP 5.2.0 from source. Maybe I should try Marc Liyanage’s installer instead. That might be the simplest option, except “This module will only work with the original Apache web server as shipped by Apple.” and I’m using a custom compiled Apache 2.
November 30th, 2006 at 12:03 PM
First, I doubt it’s using the lib in the SDK. That’s a symbols-only stub, not a loadable library with code in it.
Second, libxml2.dylib is a symlink to libxml2.2.dylib, which is the actual stub. Resymlinking libxml2.dylib would solve the problem.
Third, the real lib is in /usr/lib, and it’s also a symlink. So resymlinking it would let you change which lib PHP is using.
You could also change PHP’s dylib load path (see ‘man dylib’), so it searches someplace other than /usr/lib first. That way all the other clients of libxml2.dylib won’t be unintentionally redirected to the new lib.
I’m not sure exactly how you’d resymlink the stub lib in the SDK, or whether that’s even the best approach. Ask on Apple’s Xcode-users list for suggestions. I know that simply resymlinking has been suggested in the past, but there might be better suggestions.