Re: intl extension on os x
| From: | Tom Worster | Date: | Tue, 29 Sep 2009 14:57:32 +0000 |
| Subject: | Re: intl extension on os x | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298401@lists.php.net to get a copy of this message | ||
On 9/28/09 1:40 PM, "Tom Worster" <fsb@thefsb.org> wrote:
> anyway, in the cli the command collator_create( 'en_US' ); did not provoke
> an error, so maybe that works.
>
> but if i add extension=intl.so to php.ini and restart apache, php says: PHP
> Warning: PHP Startup: Unable to load dynamic library
> '/usr/lib/php/extensions/no-debug-non-zts-20060613/intl.so'
>
> so we're not done yet. if i get it done, maybe i'll blog my recipe.
i should have remembered this. the default config of apache22 on os x is a
64 bit binary. so if php is using apxs then php is also 64 bit. so loadable
modules need to be compiled for 64 bit.
i think the recipe below easily generalizes to other pecl extensions:
cd extname
phpize
MACOSX_DEPLOYMENT_TARGET=10.5 \
CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" \
CCFLAGS="-arch x86_64 -g -Os -pipe" \
CXXFLAGS="-arch x86_64 -g -Os -pipe" \
LDFLAGS="-arch x86_64 -bind_at_load" \
./configure --with-icu-dir=/sw
make
make install
the --with-icu-dir=/sw flag is because i used fink libicu36-dev to install
icu headers and it puts them under /sw. see:
http://pdb.finkproject.org/pdb/package.php/libicu36-dev
i haven't done much with it yet but the example here worked for me:
http://www.php.net/manual/en/collator.sort.php
i'm still unsure how to check the version of the ICU headers fink installed
vs the version of the ICU library that comes unsupported with os x.