Re: [PHP] intl extension on os x

2009-09-29 Thread Tom Worster
On 9/28/09 1:40 PM, "Tom Worster"  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.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] intl extension on os x

2009-09-28 Thread Tom Worster
On 9/28/09 2:41 AM, "Tommy Pham"  wrote:

> - Original Message 
>> From: Tom Worster 
>> To: PHP General List 
>> Sent: Sunday, September 27, 2009 5:34:45 PM
>> Subject: [PHP] intl extension on os x
>> 
>> does anyone know how to install intl on os x 10.5?
>> 
>> it seems a libicu binary is included in os x but not with headers. fink has
>> a package for installing the headers. maybe that would allow pecl to install
>> the intl extension.
>> 
>> has anyone done this successfully? or know any other way to get intl running
>> on 10.5?
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> When Apple made the big change of OS a few years back, they switch to *BSD
> based OS, with the GUI from NeXT, which Apple bought. You should be able to
> compile most linux/unix codes on Mac though.  Have you looked at Apple's
> developer's resources/documentation?

yes indeed. often you can successfully compile and install on os x things
that run on freebsd or linux. but port configuration is often substantially
different and not entirely handled by autoconf. (even compiling php requires
some tricks.) in these cases i refer to google because people smarter than
me (one assumes, everything you read on the internet being true, of course)
often blog their recipe if the find one. but i found nothing for this
problem. that's why i asked here.

at this stage, i installed the fink package libicu36-dev-3.6.0-5, supposedly
libicu headers and it seems to have done something, i'm not entirely sure
exactly what. and i'm not convinced that the headers are for the same libicu
version that's in /usr/lib.

but somehow, though i'm not clear how one configures pecl source, i managed
to get pecl to compile and install the extension.

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.

freebsd, otoh, has a port for pecl-intl so it was trivial to install. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] intl extension on os x

2009-09-27 Thread Tommy Pham
- Original Message 
> From: Tom Worster 
> To: PHP General List 
> Sent: Sunday, September 27, 2009 5:34:45 PM
> Subject: [PHP] intl extension on os x
> 
> does anyone know how to install intl on os x 10.5?
> 
> it seems a libicu binary is included in os x but not with headers. fink has
> a package for installing the headers. maybe that would allow pecl to install
> the intl extension.
> 
> has anyone done this successfully? or know any other way to get intl running
> on 10.5?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

When Apple made the big change of OS a few years back, they switch to *BSD 
based OS, with the GUI from NeXT, which Apple bought. You should be able to 
compile most linux/unix codes on Mac though.  Have you looked at Apple's 
developer's resources/documentation?

Regards,
Tommy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php