- Where is the intl PHP extension? Problem solved!
- What is PHP Intl?
- Cause
- Solutions
- For Linux-based Server (assuming you have root access):
- For Windows-based Server:
- Looking for PHP, Laminas or Mezzio Support?
- 17 Comments
- lag
- blogcahti
- giheller
- Evaldo Sobral
- Julian
- Daniela
- ElectroBuddha
- virgomez.es
- Amit
- Ed Peterson
- admin
- Gabi DJ
- Farhan Ahmed
- Hassam Ul Haq
- luis
- Shahbaaz
- Introduction
- Links
- User Contributed Notes
- admin/environment/php extension/intl
- Contents
- MS Windows
- Problems in Windows 11 VirtualBox virtual machines
- Other operating systems
- See also
- How to use the internationalization (intl) extension in PHP
- Using the internationalization extension
Where is the intl PHP extension? Problem solved!
PHP packages/frameworks/libraries/scripts we work with might require different PHP extensions. In this case the Intl extension is needed to work with using Internationalization Functions.
Got any of these error messages?
- Zend InputFilter requires intl PHP extension
- The requested PHP extension intl is missing from your system
This happened because the PHP Intl extension isn’t installed or enabled.
Parts of this tutorial can be also a guide for installing or enabling other extensions.
What is PHP Intl?
Internationalization extension (further is referred as Intl) is a wrapper for » ICU library, enabling PHP programmers to perform various locale-aware operations including but not limited to formatting, transliteration, encoding conversion, calendar operations
This extension may be installed using the bundled version as of PHP 5.3.0, or as a PECL extension as of PHP 5.2.0. In other words, there are two methods to install the intl extension.
Cause
If you have installed the unbundled PHP version, the extension is not installed on the system. (unless you’ve installed it separately)
If you have the bundled PHP version, the extension might be existing but not enabled.
Solutions
For Linux-based Server (assuming you have root access):
- Make sure the php_intl.so file exists within your php extensions directory, find the extensions directory by:
- using phpinfo()
- running this command: php -r «echo ini_get(‘extension_dir’);»
- (note: both options gets the extension_dir right from the PHP runtime configuration)
- If the file exists:
- search for the config file (php.ini, usually /etc/php.ini) and open it
- Make sure the line “extension=php_intl.so” is existing and not commented
- Restart the web server (usually sudo service httpd restart)
- Check if the extension is enabled using phpinfo()
- Check your php version by running the “php -v” command
- For PHP 5 install the php-intl package using your package manager – package managers and commands
- Most common: apt-get install php-intl (for ubuntu-based linux) or yum install php-intl (for CentOS)
For projects hosted on a shared hosting platform you must ask your hosting provider to install/enable the PHP Intl extension.
For Windows-based Server:
- Make sure the php_intl.dll file exists within your php extensions directory
- for separately installed PHP: C:\path\to\php\ext\
- for xampp: C:\path\to\xampp\php\ext
- (note: your drive letter might be different)
- If the file exists:
- search for the config file (php.ini, usually in the same folder as the php executable) and open it
- Make sure the line “extension=php_intl.dll” is existing and not commented
- Restart the web server (usually apache)
- Check if the extension is enabled using phpinfo()
- If the file doesn’t exist:
- Check your php version by running the “php -v” command
- Download the PHP version that corresponds to yours from the PHP Downloads Page (TS/NTS, x86/x64)
- To find thread safety for php, run: php -i | findstr “Thread” , source & more info.
Edit: changed php7.0 occurrences with php7.x as the version may vary.
Looking for PHP, Laminas or Mezzio Support?
17 Comments
lag
blogcahti
giheller
Evaldo Sobral
Julian
Daniela
September 3, 2019 Lendo listas de pacotes… Pronto
Construindo árvore de dependências
Lendo informação de estado… Pronto
E: Impossível encontrar o pacote php7.1-intl
E: Não foi possível encontrar o pacote através da expressão regular ‘php7.1-intl’ElectroBuddha
October 26, 2019 Thanx for this guide.
On Ubuntu, I installed php-intl, but it wasn’t working, until I checked the php version (7.2) and installed appropriate extension php7.2-intlvirgomez.es
Amit
Ed Peterson
admin
April 27, 2020 You should search for that file, can be in various locations, based on your OS and setup
Gabi DJ
April 29, 2021 To find out your configured php extensins dir:
Windows (cmd): php -i | find “extension_dir”
Windows(powershell): php -i | Select-String “extension_dir”
Linux / Mac / Windows (via cmder/laragon): php -i | grep extension_dir To find out where php is use command above and remove the extension dir at the ending (usually “ext”) or replace it with bin
eg.:
C:/php/php-7.4.15-Win32-vc15-x64/ext -> C:/php/php-7.4.15-Win32-vc15-x64 To find oud config
Windows (cmd): php -i | find “php.ini”
Windows(powershell): php -i | Select-String “php.ini”
Linux / Mac / Windows (via cmder/laragon): php -i | grep php.iniFarhan Ahmed
July 15, 2020 This is what worked for me. Goto xampp control panel, click config, select php.ini file . Search for ‘;extension=intl’ and decomment it , i.e remove the semicolon. hit save and restart xampp. For some reasons , changing the php.ini file in c:\xampp\php did not work.
Hassam Ul Haq
November 26, 2021 After modification in php.ini the below command solve my error.
– Restart the web server (usually sudo service httpd restart)luis
December 8, 2021 i have de same error, after do all de google post says, and still have the same errors: C:\Windows\system32>c:\php\php -m
PHP Warning: PHP Startup: Unable to load dynamic library ‘intl’ (tried: C:\php\ext\intl (No se puede encontrar el m├│dulo especificado), C:\php\ext\php_intl.dll (No se puede encontrar el m├│dulo especificado)) in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library ‘intl’ (tried: C:\php\ext\intl (No se puede encontrar el m├│dulo especificado), C:\php\ext\php_intl.dll (No se puede encontrar el m├│dulo especificado)) in Unknown on line 0
[PHP Modules]Shahbaaz
February 6, 2022 Hi I tried to follow the steps sudo apt-get install php7.4-intl returns – “php7.4-intl is already the newest version” but php_intl.so doesn’t exists in the php extensions directory I am running WordPress on OpenLiteSpeed server (Digital ocean shared)
Introduction
Internationalization extension (further is referred as Intl) is a wrapper for » ICU library, enabling PHP programmers to perform various locale-aware operations including but not limited to formatting, transliteration, encoding conversion, calendar operations, » UCA-conformant collation, locating text boundaries and working with locale identifiers, timezones and graphemes,
It tends to closely follow ICU APIs, so that people having experience working with ICU in either C/C++ or Java could easily use the PHP API. Also, this way ICU documentation would be useful to understand various ICU functions.
Intl consists of several modules, each of them exposes the corresponding ICU API:
- Collator: provides string comparison capability with support for appropriate locale-sensitive sort orderings.
- Number Formatter: allows to display number according to the localized format or given pattern or set of rules, and to parse strings into numbers.
- Message Formatter: allows to create messages incorporating data (such as numbers or dates) formatted according to given pattern and locale rules, and parse messages extracting data from them. It can handle plurals, locale-aware numbers, currencies, conditions and much more.
- Normalizer: provides a function to transform text into one of the Unicode normalization forms, and provides a routine to test if a given string is already normalized.
- Locale: provides interaction with locale identifiers in the form of functions to get subtags from locale identifier; parse, compose, match(lookup and filter) locale identifiers.
- Calendar: provides a class which could be used for locale-aware calendar operations and getting various information such as timezone for locale chosen, first day of week or if it’s daylight saving time now.
- Timezone: provides a wrapper around the » «Olson» database which has information about all the timezones around the world.
- Date formatter: allows to display date and time according to the localized format or given pattern or set of rules, and to parse strings into date and time.
- Transliterator: allows getting latin representation of strings in various languages.
Links
User Contributed Notes
- intl
- Introduction
- Installing/Configuring
- Predefined Constants
- Examples
- Collator
- NumberFormatter
- Locale
- Normalizer
- MessageFormatter
- IntlCalendar
- IntlGregorianCalendar
- IntlTimeZone
- IntlDateFormatter
- ResourceBundle
- Spoofchecker
- Transliterator
- IntlBreakIterator
- IntlRuleBasedBreakIterator
- IntlCodePointBreakIterator
- IntlDatePatternGenerator
- IntlPartsIterator
- UConverter
- Grapheme Functions
- IDN Functions
- IntlChar
- IntlException
- IntlIterator
- intl Functions
admin/environment/php extension/intl
The Internationalization extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalization support for software applications. It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.
The Intl extension is required in Moodle 3.4 onwards.
Contents
MS Windows
To enable this extension add the following line to your php.ini file usually found in /php:
And then set the intl.default_locale and intl.error_level directives in your php.ini file.
The intl.error_level directive is optional.
In a WAMP installation it may be required to add the php path to the system PATH so that the module4 could uploaded properly (see http://forum.wampserver.com/read.php?2,80704,82499 for a couple of other approaches).
Problems in Windows 11 VirtualBox virtual machines
If you had the msvcp110.dll missing file error, you added that file and then you got the intl missing error which can not be solved by doing the above instructions, you need to go to http://www.microsoft.com/es-es/download/confirmation.aspx?id=30679 and install the vcredist_x64.exe and vcredist_x86.exe, as described in https://stackoverflow.com/a/18876880
Other operating systems
Use system package manager or specify compilation flag.
- Debian 5.0 (& Ubuntu) use: apt-get install php-intl.
- CentOS 8.0 (& Red Hat) use: dnf install php-intl. CentOS 7.0 (& RedHat) use: yum install php-intl. The package name may be slightly different depending on the repository used for PHP packages, e.g. php74-intl.
See also
How to use the internationalization (intl) extension in PHP
This article describes how to use the internationalization (intl) extension in PHP to process and display locale-specific information.
Using the internationalization extension
A2 Hosting’s shared servers include support for PHP’s internationalization extension, which is named intl. This extension enables you to specify a locale for your PHP applications. A locale is simply is a collection of the following region-specific settings:
- The alphabetical order used to sort text strings.
- Character classification and conversion, such as between uppercase and lowercase letters.
- Currency formatting.
- Decimal separator.
- Date and time formatting.
To view a list of locales available on your server, log in to your A2 Hosting account using SSH, and then type the following command:
Most locales are in the format xx_YY, where xx is a two-letter designation for the language, and YY is a two-letter designation for a country or region. Some locales also have an additional identifier that indicates the character set. For example, en_US represents English in the United States, while zh_TW.big5 represents Chinese in Taiwan using the Big5 character set.
The following code example demonstrates how to set locales using the setlocale() function. It uses an HTML table to display the current locale setting, as well as the date, time, and a number represented in the current locale:
"; print "Encoding Date/time Number " . setlocale( LC_ALL, 0 ) . " "; // Calling setlocale() with locale '0' returns the current locale print "" . strftime( '%c' ) . " "; print "" . $number . " "; print ""; > ?>If you run this example, you see the date and time format displayed differently for each locale. Similarly, the $number variable is displayed differently: in French and Russian, the decimal separator is a comma (133,52), whereas in English it is a period (133.52).
Depending on the locale, you may also have to change the page’s character encoding set to ensure that text displays correctly. In the example above, the Cyrillic characters may not display correctly when the locale is set to Russian. One way to fix this is to specify the character set directly in the HTTP header as follows:
- To find thread safety for php, run: php -i | findstr “Thread” , source & more info.