Php intl extension windows

Введение

Модуль интернационализации (далее Intl) — это обёртка для библиотеки » ICU, позволяющая программистам на PHP производить различные операции, которые зависят от локали, например, форматирование, транслитерация, преобразование кодировок, операции с календарём, совместимое с » UCA сравнение, определение границ текста и работать с идентификаторами локалей, временными зонами и графемами.

Программный интерфейс модуля разрабатывается так, чтобы как можно точнее повторять API ICU, чтобы люди, работавшие с ICE в C/C++ или Java, могли легко использовать API PHP. Также благодаря этому документация ICE может быть полезной чтобы понять различие функции ICU.

Intl состоит из нескольких модулей, каждый из которых предоставляет соответствующий API ICU:

  • Модуль сравнения: предоставляет инструменты для сравнения строк с поддержкой соответствующего локали порядка сортировки.
  • Модуль форматирования чисел: позволяет отображать числа в соответствии с правилами локали, или заданным шаблоном или с набором правил. Также позволяет правильно разбирать строки в числа.
  • Модуль форматирования сообщений: позволяет создавать сообщения, включающие данные (такие как числа и даты), отформатированные в соответствии с заданными шаблоном и локальными правилами, и, также, разбирать сообщения, извлекая из них данные.
  • Модуль нормализации: предоставляет функции для преобразования текста в одну из нормализованных форм Unicode. Также предоставляет возможность проверить, является ли предоставленный текст уже нормализованным.
  • Модуль локали: предоставляет взаимодействие с идентификаторами локали как к функциями, позволяя получить вложенные теги локали; разбор, композиция, сравнение (поиск и фильтрация) идентификаторов локали.
  • Модуль календаря: предоставляет класс, полезный для проведения зависимых от локали операций с календарём, получения различной информации, такой как временные зоны для выбранной локали, первый день недели или режим текущего зимнего/летнего времени.
  • Модуль временной зоны: предоставляет обёртку над » базой данных временных зон, в которой содержится исчерпывающая информация о всех мировых временных зонах.
  • Модуль форматирования даты: позволяет отображать дату в соответствии с принятым для данной локали форматом либо заданным шаблоном или набором правил. Также нужен для разбора строк, содержащих описание даты и времени.
  • Модуль транслитерации: позволяет получить представление строки на различных языках в латинице.

Обновляем расширение Intl в PHP 7 на Linux Ubuntu 16.04

Программисты делятся на два типа: консерваторы, для которых переход на новую версию равносилен перелёту на другую планету (если читаешь это из Windows XP — поздравляю, это ты); и Викторы Цои, чьи сердца и глаза требуют перемен, и обновляют всё и вся при первой возможности. Если ты второго типа, и у тебя уже стоит последняя версия PHP на последней LTS версии Ubuntu, но покоя не даёт то, что расширение Intl использует устаревшую версию библиотеки ICU, или тебе просто понравились картинки из «Аватара» — добро пожаловать под кат! (Картинок больше не будет.)

Ну и зачем это?

Библиотека ICU с каждым релизом добавляет поддержку стандартов транслитерации для различных языков, добавляет новые функции и возможности, фиксит баги. Пока неизвестно, по какой причине PHP нерегулярно обновляет ICU в расширении Intl. Поэтому приходится всё брать в свои руки.

Поиск решения

Быстрый поиск по гуглу не дал внятных решений. Детальный тоже. В общем и целом пэхэпэшным программистам по барабану, какую версию ICU использует Intl. Но только не нашим! Отчаявшись искать в англоязычном сегменте интернета, совершенно случайно набрёл на запись русского блогера Сергея Стоянова, где он объясняет процесс обновления ICU в PHP 5 для Ubuntu 14.04. В PHP 7 процесс сильно отличается, но общая последовательность действий остаётся такой же: удаляем Intl; собираем новую версию ICU; устанавливаем Intl, ткнув его носом, где искать ICU; включаем Intl в PHP; открываем шампанское. Также сильно помогли комментарии к статье (особенно комментарий Антона Минина и его shell скрипт).

Читайте также:  Мигает монитор ноутбука windows 10

Версии ICU

Проверить последнюю версию ICU можно на их официальном сайте. На данный момент (февраль 2018) последний релиз — 60.2.

Чтобы проверить, какую версию ICU использует php7.0-intl, напиши в терминале и прокрути до списка установленных модулей. Найди там раздел, озаглавленный «intl». У меня там было:

Internationalization support => enabled
version => 1.1.0
ICU version => 55.1
ICU Data version => 55.1

Мягко говоря, не айс — версия 55.1 была выпущена в первой половине 2015-го, и с тех пор успела обновиться ещё 5 раз. Нужно же что-то делать!

Решение

Internationalization support => enabled
version => 1.1.0
ICU version => 60.2
ICU Data version => 60.2

Why can’t PHP on Windows see extension php_intl.dll even though it exists?

I’ve been trying to get the intl extension working on my test workstation (PHP 5.5.1, Apache 2.2.4, Windows 7 32-bit). It seems that no matter what I try I can’t get it up and running.

  • I’ve uncommented the line «extension=php_intl.dll» in my php.ini.
  • I’ve verified the extension_dir directive is pointing at the correct directory (c:\wamp\php5.5\ext).
  • I’ve verified php_intl.dll is in c:\wamp\php5.5\ext.
  • I’ve verified that all the icu*.dll files are present in the php root directory (c:\wamp\php5.5).
  • I’ve verified that c:\wamp\php5.5 is in my PATH.
  • And yes, the copy of php.ini I’m editing is the correct one, the one specified by the PHPIniDir directive in httpd.conf.

I’ve checked the Apache error log and found this line every time I’ve restarted Apache:

PHP Warning: PHP Startup: Unable to load dynamic library ‘c:\wamp\php5.5\ext\php_intl.dll’ — The specified module could not be found.\r\n in Unknown on line 0

I repeat myself, but c:\wamp\php5.5\ext\php_intl.dll DOES EXIST!

I’m tempted to try pointing at Windows Explorer and shouting at my computer, «LOOK! THE STINKIN’ FILE IS RIGHT THERE!» Any idea why I can see the file and PHP cannot even though we’re apparently looking in the same directory? Or is something else going on that I’ve missed?

7 Answers 7

Make sure that Apache can find and load icu*.dll files from PHP base dir.

Fast, simple solution is to copy these dll’s to Apache bin directory.

Although SeventyFourLaboratories’s solution is simple and it works, there is a solution that doesn’t require you to modify your Apache or PHP distribution (and sometimes, you are not allowed to change them in production servers).

You said you’ve verified C:\wamp\php5.5 is in your PATH . Windows has two kinds of environment variables: user and system variables.

I’ve tried to set C:\wamp\php5.5 in my user variable PATH , and it doesn’t work. But, setting it in the system variable PATH makes it work. So, you should verify that you use the PATH system variable to configure Apache instead of a user variable with the same name.

Читайте также:  Как определить тип лицензии windows

I had this exact same problem and after close to 5 hours of working on this issue I finally got it resolved. There were two main changes that I had to make.

1) When I downloaded the extension I was trying to use, it came with many other files beyond just the .dll file — most of them were .pdb. I moved all of them into the ext folder that contains the .dll files.

2) The answer by smaines at alaya dot com provided as a comment here gave me the second thing that I needed to do — add the path to the ext folder to windows $PATH variable.

There are many ways this can be done, here is one:

  • Go to my computer
  • Right click and select properties
  • Click ‘Advanced system settings’ on the left
  • Click on the ‘Advanced’ tab at the top
  • Click the ‘Environment Variables’ button
  • Search through the list of variables to find the ‘Path’ variable, select it
  • Click the ‘Edit. ‘ button (when the ‘Path’ variable is selected)
  • This will bring up another dialog box with two input fields. The bottom one is the variable, select it.
  • Append to the end a semicolon then the path, in this case you would type ‘;C:\wamp\php5.5\ext’ (the semicolon is just to separate it from the previous path
  • click ‘OK’ in all the dialog boxes that have come up to close them

After making the above changes you need to restart your machine for them to take affect.

I hope that helps, it worked for me. It seems like this is a fairly common problem — at least I found quite a few discussions on it and variations of it.

how can I enable PHP Extension intl?

I am going to install Magento2 at my local server and it gives me following error notice.

I am using XAMPP. When I tried to enable it from php.ini file it throws another error for missing dll:

The program can’t start because MSVCP110.dll is missing from your computer. Try reinstalling the program to fix this problem.

23 Answers 23

First of all stop the xampp/wamp and then kindly remove the starting semicolon ( ; ) from your xampp/php/php.ini the following code.

And then restart your xampp/wamp.

I wrote this post if anyone come across this question for PrestaShop, I don’t know if it will work for Magento2. I solved enabling PHP extension intl for the PrestaShop installation by:

  1. Open XAMPP Control Pane.
  2. Stop the Apache server if it was started.
  3. Then from Config button click on PHP (php.ini) item.

  1. Php.ini will open in Notepad (or a default text editor), click Ctrl + F and search for ;extension=intl and remove the semicolon.

  1. Then save and close Notepad and re-start the Apache server.

These steps for me solved the issue.

Note (2): I’m using XAMPP v3.2.3 and PrestaShop v1.7.5.1

I was also having the same issue, and just now i got it solved. Please try the bellow steps to get it solved:

  • Open php.ini and remove semicolon (;) from ;extension=php_intl.dll
  • When you try to restart the apache it will through some errors, that might be because of some .dll files. Simply copy all the icu****.dll files
  • Still i was getting msvcp110.dll file missing error. I have downloaded this missing file from Here and put that in desired location

For windows 7 32 bit it is — C:\Windows\System32

  • Now Start Apache and it is working fine.
Читайте также:  Как делать оценку windows системы

If you are using ubuntu you can take update

And install extension in case of php 5.6

And in case of php 7.0

And restart your apache after

If you are using xampp then remove semicolon ( ; ) in xampp/php/php.ini from below line

And then restart your xampp.

I have seen the screen shoot, the issue you are having is missing msvcp110.dll , this file you can download from

and upload to C:/Windows folder

than after edit php.ini from XAMPP

Save the file and restart Apache from XAMPP

For Megento Installation you Need to

  1. Stop Apache Service
  2. uncomment the extension=php_intl.dll in php.ini file.
  3. copy all 6 files icudt57.dll,icuin57.dll,icuio57.dll,icule57.dll,iculx57.dll,icuuc57.dll From php folder to apache\bin Now Restart you apache service

All you need to do is go to php.ini in your xampp folder (xampp\php\php.ini) and remove ; from ;extension=php_intl.dll

ADDITIONAL NOTE (As this is very old question and has no accepted answer yet)

here is the notes I see in my php.ini file.

Note : The syntax used in previous PHP versions (‘extension=.so’ and ; ‘extension=’php_.dll’) is supported for legacy reasons and may be ; deprecated in a future PHP major version. So, when it is possible, please ; move to the new (‘extension=) syntax.

So you will only find the extension name as intl instead of php_intl.dll and then uncommenting that line should work (It worked for me atleast).

Simply copy all icu****.dll files from

intl extension will start working.

I have found two errors during the installing of Magento to localhost.
There are PHP Extension xsl and intl and I have solved the issue by following steps.

  1. Open php.ini
  2. Remove ‘#’ cha from the lines extension=php_xsl.dll and extension=php_intl.dll.
  3. Save the file and restart xamp again
  4. Click Try Again on Magento installation page.

Then all the things were passed as well as following picture.

I was having same kind of problem with ldap, intl, curl php extensions. I’ve solved those issues by the following ways:

At first you’ve to check whether these extensions have been enabled in the php.ini file by removing semicolon (;) in front of the following lines:

Secondly, libeay32.dll, ibssh2.dll and ssleay32.dll files have to be loaded by php properly to function those extensions properly. These dll files are required by several php extensions (ie curl, ldap, intl etc). These files generally reside in the php installation directory [for my case it is C:\php directory]. Additionally, for intl extension to be enabled you’re gonna need some other dll files to be loaded by php properly. The name of these files begin with icu (ie icudt57.dll icuin57.dll etc for php version 5.6). You’ll also find these files in the php main installation directory.

Оцените статью