Monthly Archive for May, 2010

Compiling PHP 5.2.11 on OS X 10.5.8

I’ve detailed this problem before but yet again I’ve encountered the infamous iconv compile error. This bug is not new yet it still has not been fixed in the latest PHP release.

When compiling a custom version of PHP with libraries such as libxml and iconv the

make

process results in a linking error relating to the iconv library. The problem arises because I have two versions of iconv installed – the macports version in addition to the standard installation. A linking conflict arises and to eliminate the error a linking search order change (which is detailed in my previous blog post) must be made. In addition to the makefile modification, the previous workaround for the bug also included using

--with-iconv=shared,/opt/local

instead of the standard

--with-iconv

. Either the latest PHP (5.2.11) or OS X update has caused that workaround not to function correctly, now only

--with-iconv=/opt/local

should be used.

I’ve posted a script that I’m now using to keep my PHP installation up to date.