- 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
- How do I install PHP intl extension on CentOS?
- Solution – 1
- 1) Remove remi Packages
- 2) Downgrade php-common to Version 5.3.3-14
- Solution – 2
- Solution – 3
- Solution – 4
- Solution – 5
- Solution – 6
- admin/environment/php extension/intl
- Contents
- MS Windows
- Problems in Windows 11 VirtualBox virtual machines
- Other operating systems
- See also
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)
How do I install PHP intl extension on CentOS?
I know virtually nothing about installing packages. I managed to install Zend Framework 1 with yum a while back by following a very specific tutorial.
Now I need the PHP intl extension and I can’t figure out how to install it.
and saw that there was one available. So I did
and got the following error message:
Error: Package: php-intl-5.3.3-14.el6_3.x86_64 (updates) Requires: php-common = 5.3.3-14.el6_3 Installed: php-common-5.3.17-2.el6.remi.x86_64 (@remi) php-common = 5.3.17-2.el6.remi Available: php-common-5.3.3-3.el6_2.8.x86_64 (base) php-common = 5.3.3-3.el6_2.8 Available: php-common-5.3.3-14.el6_3.x86_64 (updates) php-common = 5.3.3-14.el6_3 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
I did not try the suggestions mentioned in the message because I didn’t know what they would do and I am afraid of breaking something. This is a production machine and I don’t have another machine to test on. I tried to find an rpm to download that was the same version as my PHP, but had no luck.
What do those two suggestions do and are they safe to try?
What else can I try to get the intl extension installed?Solution – 1
Yum is throwing an error because we are attempting to update multiple packages to versions that conflict. Your yum output says that php-intl requires a specific version of the php-common. Removing all the junk:
Requires 5.3.3-14 Installed 5.3.17-2 Available 1st Option: 5.3.3-3 Available 2nd Option: 5.3.3-14
This tells us that you already have installed a more recent version of php-common (5.3.17-2) than is allowed by php-intl.
I think you have two options. (As a newbie myself, I would not attempt these without practicing in a dev environment.)
1) Remove remi Packages
Quoting from a similar question on Super User. “Try removing all remi php packages, disable remi repository and install the default centos 6 php 5.3.3 packages.”
2) Downgrade php-common to Version 5.3.3-14
I have no idea if you would run into more dependency issues and have to downgrade other packages. I found more details here.
Other Stack Exchange sites show similar questions.
Solution – 2
As you have php-commom from remi repositories, you need to get php-intl from remi also.
Add —enable-repo option as follows:
yum --enablerepo=remi install php-intl
Solution – 3
If you have higher PHP version like 5.6, you have to enable both remi and remi-php56 repos to install all the additional dependencies:
yum --enablerepo=remi,remi-php56 install php-intl
Solution – 4
I successfully installed INTL via pecl using following steps.
yum -y install icu libicu libicu-devel
2) php-devel package and phpize:
yum -y install php-devel phpize
yum -y install gcc gcc-cpp gcc-c++
This is working for me.my php version is 5.6.12
Solution – 5
#list all options $ sudo yum list php7*intl #install $ sudo yum install php70-intl
Solution – 6
To elaborate just a little on @Fernando Valler‘s answer.
On my Fedora 35 machine, I have multiple installs of php. To check how many, I use a tool by Symfony (I am not sure how to do otherwise so quickly):
$ symfony local:php:list +---------+--------------------------+---------+ | Version | Directory | PHP | +---------+--------------------------+---------+ | 7.4.30 | /opt/remi/php74/root/usr | bin/php | | 8.0.22 | /usr | bin/php | | 8.1.10 | /opt/remi/php81/root/usr | bin/php | +---------+--------------------------+---------+
Say I miss intl for version 8.1.10. First check whether intl.so is indeed not within its modules directory: php81 -r «echo ini_get(‘extension_dir’);» .
To install it, check packages by dnf list php*intl , you get something like:
$sudo dnf list php*intl Installed Packages php-intl.x86_64 8.0.22-1.fc35 @updates Available Packages php-intl.x86_64 8.0.23-1.fc35 updates php-symfony-intl.noarch 2.8.52-7.fc35 fedora php-symfony3-intl.noarch 3.4.49-2.fc35 fedora . php72-php-intl.x86_64 7.2.34-11.fc35.remi remi php81-php-intl.x86_64 8.1.10-1.fc35.remi remi php82-php-intl.x86_64 8.2.0~rc2-15.fc35.remi remi
Select what you need, say for php8.1.10 , and install intl extension for it: sudo dnf install php81-php-intl . It will pop up within the modules directory for php 8.1.
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
- To find thread safety for php, run: php -i | findstr “Thread” , source & more info.