I am trying to install the PHP extension extension in my new OS X 10.6.6 installation using the version of PHP that comes with it (v5.3.3).
I know that an extension requires an ICU, so I installed it using homebrew. My installed ICU version is 4.4.1 and is stored in /usr/local/Cellar/icu4c/4.4.1 .
I tried two different ways to install the intl extension:
pecl install
pecl asked me about the ICU prefix, which is /usr/local/Cellar/icu4c/4.4.1 . configure worked without problems, however make aborted:
/private/var/tmp/apache_mod_php/apache_mod_php-53~1/Build/tmp/pear/temp/intl/collator/collator_class.c:107: error: duplicate 'static make: * [collator / collator_class.lo] Error 1 ERROR: `make 'failed
build directly
I downloaded the current version of PHP (v5.3.5) and then installed the intl extension from ext/intl by doing:
phpize && configure --enable-intl --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1 && make && make test && sudo make install
It seemed to work; I received the extension in the PHP extension directory and did not receive error messages.
File tells me: 64-bit Mach-O x86_64 package
However, when I downloaded the extension in php.ini , I received a message:
PHP Warning: running PHP: invalid library (maybe not a PHP library) '/usr/lib/php/extensions/no-debug-non-zts-20090626/intl.so' in Unknown on line 0
I have no idea why this is happening. I assume this is because the extension is installed from PHP v5.3.5, and I am using v5.3.3, but I canβt imagine that the 2 fix releases will violate compatibility.
Any ideas?
UPDATE 2011-03-16:
I have found a solution! When I explicitly set the -m64 flag to configure (which tells gcc to release 64-bit code), then the extension loads correctly:
CFLAGS=-m64 CPPFLAGS=-m64 CCASFLAGS=-m64 ./configure