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 :)

Manne W
  • 1,459
  • 4
  • 17
  • 31
  • 1
    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: https://github.com/symfony/symfony-standard/blob/master/app/autoload.php#L23 – igorw Mar 30 '11 at 13:10
  • 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: http://stackoverflow.com/questions/10717752/having-problems-while-try-to-install-oauth-with-pecl-in-mamp-on-mac-os-lion – AsTeR Jun 12 '13 at 12:30

2 Answers2

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

j0k
  • 22,600
  • 28
  • 79
  • 90
Antoine
  • 5,504
  • 5
  • 33
  • 54
  • 2
    This seems to me the simplest way, thanks! I also enabled the apc.so accelerator like this, for Symfony2. – fishbaitfood Jan 13 '13 at 17:32
  • Nice, better solution than the "chosen" solution. Here's also a nice blog post with an alternative solution: http://blog.geertvd.be/2011/05/18/installing-the-intl-extension-on-mamp/ – Daan Feb 08 '13 at 10:32
  • 1
    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](http://blog.geertvd.be/2011/05/18/installing-the-intl-extension-on-mamp/#comment-22026) and [this guys keeps a version of intl.so up-t-date for MAMP](https://github.com/skmedia/php-extensions-mamp) – Daan Feb 08 '13 at 14:10
  • And if you keep getting an error, [here's how to compile it yourself](https://github.com/skmedia/php-extensions-mamp/issues/1#issuecomment-9179063). – Daan Feb 08 '13 at 14:34
  • Great solution. For future visitors in need of a solution, this is the easiest solution! +1 – Carrie Kendall Jun 06 '13 at 13:26
  • 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" – Rafa Jun 19 '13 at 11:59
  • ditto for Mojave – geoidesic Jun 11 '19 at 15:27
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. :)

szemian
  • 2,381
  • 3
  • 18
  • 22
  • Great! This one worked just fine! Will act as a self reminder for me too :) – Manne W Mar 29 '11 at 12:54
  • 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. – szemian Mar 29 '11 at 14:38
  • 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 forms – LondonGuy Jun 01 '11 at 14:20
  • @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? – szemian Jun 02 '11 at 10:34
  • 2
    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. – LondonGuy Jun 02 '11 at 14:27
  • 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: http://blog.geertvd.be/2011/05/18/installing-the-intl-extension-on-mamp/ – linuxatico Jun 20 '12 at 14:04