Install/activate PHP "intl" extension running MAMP
Asked Answered
L

2

13

Ok, I'm running MAMP 1.9.5, which includes PHP 5.3.5, on my MacBook Pro.

The "intl" extension isn't included/activated and I've tried a lot of different ways to install it ("./pecl install intl" doesn't seem to do it), but can't make it work.

I've also "googled my ass of" but can't find any hints.

Anyone of you that know how to do it? Or, alternatively, have and advice on how to install my own MySQL+Apache+PHP (and include "intl")?

I'm trying to do this to be able to run Symfony2. So if you have any advice on how to install MySQL+Apache+PHP+Symfony2 on Mac, thats also welcome :)

Loyalist answered 29/3, 2011 at 7:48 Comment(2)
Note that there is a stub implementation of intl included with Symfony2 which will provide you with the bare minimum of functionality for the 'en' locale. The standard edition loads the stubs by default: github.com/symfony/symfony-standard/blob/master/app/…Berryman
After a first tried with pecl install intl (inside /Applications/MAMP/bin/php/php5.4.10/bin) that run into another kind of problem. I found my solution here: #10718252Tawannatawdry
C
4

I just compiled on mine the other day.

I wrote a self reminder post here: http://szemian.wordpress.com/2011/03/21/compiling-intl-extension-for-mamp/

Let me know if you need further explanation. :)

Champac answered 29/3, 2011 at 12:43 Comment(6)
Great! This one worked just fine! Will act as a self reminder for me too :)Loyalist
Glad it works! :) To be honest I haven't used it as I haven't worked on form validation yet. Please leave a comment if the extension is not working as expected.Champac
Compiles for me and symfony2 stops asking me to install and enable it but it fails make test and gives me errors when i try to create a date field in formsArrow
@Psychonetics, I still haven't developed much on form and validation, just playing with the examples on the official documentation. I did not have any error when I tried a date form field type and validate it on latest beta. Would you elaborate the errors?Champac
I solved my issue by downloading and install zend server ce, I took the compiled intl.so and added it to my MAMP setup and it worked fine. I decided to just use zend server ce instead as it has many other extensions pre-installed. Date field is working fine and i'm getting 0 errors.Arrow
This solution did not work for me, the "make" step just after the "./configure –enable-intl –with-icu-dir=/Applications/MAMP/Library/" failed because of a bunch of errors, the first is "In file included from /Users/simone/Downloads/php-5.3.10/ext/intl/php_intl.c:25: /Users/simone/Downloads/php-5.3.10/ext/intl/php_intl.h:23:17: error: php.h: No such file or directory" I solved by installing Macports and following this guide: blog.geertvd.be/2011/05/18/…Dias
U
21

The best way is to download PHP for OSX at http://php-osx.liip.ch/ and then copy the intl.so file from

/usr/local/php5-20121126-100332/lib/php/extensions/no-debug-non-zts-20100525/intl.so

to

/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/intl.so

Worked like a charm for me for PHP 5.4

Unchaste answered 3/1, 2013 at 9:17 Comment(7)
This seems to me the simplest way, thanks! I also enabled the apc.so accelerator like this, for Symfony2.Oology
Nice, better solution than the "chosen" solution. Here's also a nice blog post with an alternative solution: blog.geertvd.be/2011/05/18/…Fawkes
I using the right php.ini file, but it wasn't working. I found a PHP startup log saying the extension wasn't compiled with the same module as PHP so my intl.so extension was not loading. PHP Warning: PHP Startup: intl: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100525 These options need to match This comment helped me and this guys keeps a version of intl.so up-t-date for MAMPFawkes
And if you keep getting an error, here's how to compile it yourself.Fawkes
Great solution. For future visitors in need of a solution, this is the easiest solution! +1Aube
FYI, won't work with MAMP 1.9 (php 5.3.2, same as Ubuntu 10.0.4 LTS) in Snow Leopard due to diferent architecture "intl.so: mach-o, but wrong architecture"Godber
ditto for MojaveStrike
C
4

I just compiled on mine the other day.

I wrote a self reminder post here: http://szemian.wordpress.com/2011/03/21/compiling-intl-extension-for-mamp/

Let me know if you need further explanation. :)

Champac answered 29/3, 2011 at 12:43 Comment(6)
Great! This one worked just fine! Will act as a self reminder for me too :)Loyalist
Glad it works! :) To be honest I haven't used it as I haven't worked on form validation yet. Please leave a comment if the extension is not working as expected.Champac
Compiles for me and symfony2 stops asking me to install and enable it but it fails make test and gives me errors when i try to create a date field in formsArrow
@Psychonetics, I still haven't developed much on form and validation, just playing with the examples on the official documentation. I did not have any error when I tried a date form field type and validate it on latest beta. Would you elaborate the errors?Champac
I solved my issue by downloading and install zend server ce, I took the compiled intl.so and added it to my MAMP setup and it worked fine. I decided to just use zend server ce instead as it has many other extensions pre-installed. Date field is working fine and i'm getting 0 errors.Arrow
This solution did not work for me, the "make" step just after the "./configure –enable-intl –with-icu-dir=/Applications/MAMP/Library/" failed because of a bunch of errors, the first is "In file included from /Users/simone/Downloads/php-5.3.10/ext/intl/php_intl.c:25: /Users/simone/Downloads/php-5.3.10/ext/intl/php_intl.h:23:17: error: php.h: No such file or directory" I solved by installing Macports and following this guide: blog.geertvd.be/2011/05/18/…Dias

© 2022 - 2024 — McMap. All rights reserved.