11

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 install and enable intl.

I tried reading PEAR's and PECL's guides, since I'm total 0 on this topic(started learning PHP recently), but nothing worked.

I found php_intl.dll inside my C:\xamp\php\ext. The php.ini's extension_dir= is set to "C:\xampp\php\ext". I was only missing the extension=php_intl.dll inside php.ini, so I added it.

Unfortunately it didn't work, and Symfony keeps asking me for intl.

Bob
  • 1,355
  • 5
  • 19
  • 38
  • 1
    tried ./ext for the extension dir? which php version is it? – Hajo Apr 18 '12 at 21:18
  • Just did. It doesn't help. It tells me it can't load `php_bz2.dll` which is the first uncommented extension listed inside the php.ini – Bob Apr 18 '12 at 21:22
  • is it raw xamp or done some modifications on how php and apache are going to use each other? – Hajo Apr 18 '12 at 21:26
  • I just ran `XAMPP`'s installation file, followed all instructions without modifying anything, and that was it. – Bob Apr 18 '12 at 21:31
  • php 5.4 comes with a builtin webserver, maybe it works that way. if that is no solution try to reinstall xamp or adjust its configs – Hajo Apr 18 '12 at 21:33
  • http://php.net/manual/en/features.commandline.webserver.php – Hajo Apr 18 '12 at 21:33

7 Answers7

11

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.

ThomasPeeters
  • 256
  • 3
  • 8
5

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

Hajo
  • 849
  • 6
  • 21
5

Follow these steps:

  1. Copy all the file names starting with "icu" from C:\wamp\bin\php\php5.5.12 and paste to C:\wamp\bin\apache\apache2.4.9\bin (I am using WAMP. Figure it out yourself for XAMP.)

You can try. Nothing will harm. If you feel the things are not working, you can delete them. I am sure it will work for you 100%.

  1. Uncomment the following line on C:\wamp\bin\apache\apache2.4.9\bin\php.ini

    extension=php_intl.dll
    

It will work.

srbhattarai
  • 792
  • 7
  • 9
3

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

javier_domenech
  • 5,995
  • 6
  • 37
  • 59
1

For OS X users:

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

Community
  • 1
  • 1
Stan Fad
  • 1,124
  • 12
  • 23
0

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 !

Charles
  • 320
  • 2
  • 8
0

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