Problem

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.

What is Internationalization?

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

Source: PHP Documentation

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.

Source: PHP Documentation

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()
  • If the file doesn’t exist
    • 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 PHP 7, install the php7.x-intl (depending on your php version)
    • Repeat the steps for the case in which the file exists

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)
    • Search for the php_intl.dll file in the ext folder in that version and copy it in your php\ext folder
    • Repeat the steps for the case in which the file exists

Edit: changed php7.0 occurrences with php7.x as the version may vary.


Looking for PHP, Laminas or Mezzio Support?

As part of the Laminas Commercial Vendor Program, Apidemia offers expert technical support and services for:

  • Migration from Laminas MVC to Mezzio or Dotkernel Headless Platform.
  • Migration from legacy Laminas API Tools (formerly Apigility) to Dotkernel API
  • Mezzio and Laminas Consulting and Technical Audit
  • Modernising Legacy Applications
  • 17 Comments

    1. lag

      in new version php decomment
      extension=intl

      • blogcahti

        thanks bro, i was trying many time and now its solved.

    2. giheller

      this file exist
      uncommented in php.ini
      no found with phpinfo();
      what(s appen

    3. Evaldo Sobral

      please, correct the command php -r. It is missing a (“) at the end. Thank you.

    4. Julian

      Fixed the incorrect bash command

    5. Daniela

      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’

    6. ElectroBuddha

      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-intl

    7. Amit

      thanks man

    8. Ed Peterson

      You advise to edit a file, but you don’t explain where the file is.

      • admin

        You should search for that file, can be in various locations, based on your OS and setup

      • Gabi DJ

        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.ini

    9. Farhan Ahmed

      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.

    10. Hassam Ul Haq

      After modification in php.ini the below command solve my error.
      – Restart the web server (usually sudo service httpd restart)

      • luis

        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]

    11. Shahbaaz

      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)

    Leave a Reply to luis Cancel Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>