40

I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo() but that extension doesn't exist! :(

How can I install this extension without compiling it? Here is just source of it.

Bira
  • 4,531
  • 2
  • 27
  • 42
Jalal
  • 6,594
  • 9
  • 63
  • 100

6 Answers6

71

The extension was there! All you need to do is clearing the comment(;) before this line in php.ini file:

Windows:

;extension=php_intl.dll

to

extension=php_intl.dll

Linux:

;extension=intl

to

extension=intl

Then restart apache2 or php-fpm if you are using it.

If it does not work, then you probably need to change it in the php.ini of the CLI version. First check your version with php --version though, so that you change the right php.ini file, it might be different from your php fpm version.

It also might be enough to just install the package e.g. for php 8.2: sudo apt install php8.2-intl

Black
  • 18,150
  • 39
  • 158
  • 271
Jalal
  • 6,594
  • 9
  • 63
  • 100
  • 1
    and don't forget to add C:\xampp\php to your system path if you are using XAMPP – Ehsan Zargar Ershadi Aug 24 '13 at 09:38
  • 3
    I had the same issue, but even when I uncommented this line - module wasn't loaded properly (no errors in php/apache logs). So please be sure that version of module is correct for the current php version :) – Andron Nov 05 '13 at 10:19
  • 1
    In my case it was extension=intl – M at Jul 15 '19 at 08:18
  • 2
    If it does not work, then you probably need to change it in the php.ini of the CLI version. – Black Oct 27 '22 at 09:59
33

if you see this on Debian / other Linux platforms.

sudo apt-get install php5-intl - for PHP 5.6

sudo apt-get install php7.0-intl - PHP 7+

Amazon Linux

sudo yum install php70-intl

After that restart Apache services.

sudo service apache2 restart restart apache to get the changes.

Bira
  • 4,531
  • 2
  • 27
  • 42
5

in wamp or xampp open php.ini file and find the below line, then remove comment (;) at first of it:

;extension=php_intl.dll

if you did not find the line, add it in the php.ini file:

extension=php_intl.dll

Mohammad Aghayari
  • 1,010
  • 3
  • 15
  • 38
4

It may be because of Apache. Restart Apache by following command

service httpd restart 

and try again.

rmunn
  • 34,942
  • 10
  • 74
  • 105
Archana
  • 359
  • 2
  • 5
  • 14
0

If you added extension=php_intl.dll in your php.ini and it didn't work you can copy icu****.dll files (about five of them) from PHP folder to Apache /bin folder then restart Apache and try again.

helvete
  • 2,455
  • 13
  • 33
  • 37
0

If you are creating a software package for deployment on systems you don't manage, there is an alternative to editing php.ini. You can use the Symfony version of IntlDateFormatter. With some editing, this can be modified to run in your application.

Note: this solution only makes sense if you cannot edit php.ini (and if necessary copy the ICU files into Apache). Otherwise, the "with some editing" portion of this makes the whole thing more complicated than just enabling intl. Putting this answer here, as this is the earliest question asking about the relevant error.

People who find this useful should upvote this answer to How to use IntlDateFormatter in Symfony?. That provided an important missing step.

mdfst13
  • 850
  • 8
  • 18