I\'m using XAMPP for Windows
and decided to try out Symfony 2
.
As soon as I get to Symfony Configuration
page it recommends me to
To activate this extension in Xampp, just edit your php.ini (i.e. in C:\xampp\php directory) and remove the semicolon to uncomment this line :
;extension=php_intl.dll
Eventually don’t forget to restart Apache !
1.Normally, the PHP is automatically installed on OSX. So, if you would like to use the XAMPP, or whatever apache server, you must change the path point to XAMPP. You can check the path by using:
$ which php
(do not copy $ sign, it means than you should type this in Terminal, not php)
You should get: /Applications/XAMPP/xamppfiles/bin/php
,
if not, you will get /usr/bin/php
.
This is OSX' php. So, you have to change it to XAMPP' php by using:
$ PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}"
2.Run this command to download, unpack, compile and install ICU (you can choose different version is your Symfony required):
$ curl -sS -o /tmp/icu.tar.gz -L http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz && tar -zxf /tmp/icu.tar.gz -C /tmp && cd /tmp/icu/source && ./configure --prefix=/usr/local && make && sudo make install
than run:
$ sudo pecl install intl
and specify where ICU libraries and headers can be found [DEFAULT] :
/usr/local
Pay attention to information in install report:
You should add "extension=intl.so" to php.ini
Don't forget to reboot Apache and check version:
<?php
if (extension_loaded('intl')) {
echo "PHP: " . PHP_VERSION . "<br>\n";
echo "ICU: " . INTL_ICU_VERSION . "<br>\n";
} else {
die('OOPS! The intl extension is not enabled!');
}
Partially taken from here but modified to get success Install PHP Internationalization extension (Intl) on XAMPP on Mac
To solve this go to "c:\xampp\php\php.ini" open it in your editor and search for Dynamic Extensions then go down search for ;extension=php_intl.dll and enable it(remove ; to became like ) extension=php_intl.dll after that save your file php.ini and restart your localhost
For Linux users: Installing php5-intl made it work for me
sudo apt-get install php5-intl
found here: http://www.php.net/manual/en/intl.setup.php
http://php.net/manual/en/intl.requirements.php
This extension is bundled with PHP as of PHP version 5.3.0. Alternatively, the PECL version of this extension may be used with all PHP versions greater than 5.2.0 (5.2.4+ recommended).
also read my comment to your post above
Whenever you make changes to php.ini
, remember to restart Apache
. Otherwise the changes won't take effect. You can do this in the XAMPP Control Panel
by clicking the stop/start
button in the Apache
module row.