Php intl как установить

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

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

                Farhan 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 to Install PHP Intl extension using Terminal and Cpanel

                In this post, you will learn how to install PHP intl extension using SSH and Cpanel. Intl extension will enable us to perform UCA-conformant collation and date, time, number, and currency formatting. In this tutorial, we have 2 options on how to install the intl extension if you have root access we can use a terminal with SSH and Cpanel for Cpanel users.

                In my Cpanel example, I’m currently using Namecheap Hosting. Just click the link for more details.

                Install Intl extension using Terminal

                If you have root access to your server using SSH then you can perform this. We need to update first the packages that are currently installed in our user’s system.

                Once the above command is already finished. Then run the following command:

                Note: Please select only base on your installed PHP version.

                #use below command if your PHP version is 7.4 sudo apt-get install php7.4-intl #use below command if your PHP version is 8.0 sudo apt-get install php8.0-intl #use below command if your PHP version is 8.1 sudo apt-get install php8.1-intl

                Install Intl extension using Cpanel

                If you are using Cpanel. Follow the following steps:

                Once you are in the Cpanel dashboard already. Kindly scroll and find the Software panel.

                Step 1: Under Software Panel Select PHP Version

                install php intl extension

                Step 2: Then select your PHP version. In my case, I will select 8.1 since that is the PHP version I’m using.

                install intl extension

                Then scroll below or CRTL+F then search intl keyword.

                install intl extension using cpanel

                Then check the intl checkbox. Then it will automatically save. It depends on your Cpanel.

                Источник

                How To Install php-intl on Ubuntu 20.04

                In this tutorial we learn how to install php-intl on Ubuntu 20.04.

                What is php-intl

                This package provides a Internationalisation module for PHP.

                PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

                This package is a dependency package, which depends on Debian’s default PHP version (currently 7.4). Description-md5: 18970e739c46c7e0a8e4ab2bb4153c4f

                There are three ways to install php-intl on Ubuntu 20.04. We can use apt-get , apt and aptitude . In the following sections we will describe each method. You can choose one of them.

                Install php-intl Using apt-get

                Update apt database with apt-get using the following command.

                After updating apt database, We can install php-intl using apt-get by running the following command:

                sudo apt-get -y install php-intl 

                Install php-intl Using apt

                Update apt database with apt using the following command.

                After updating apt database, We can install php-intl using apt by running the following command:

                sudo apt -y install php-intl 

                Install php-intl Using aptitude

                If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

                After updating apt database, We can install php-intl using aptitude by running the following command:

                sudo aptitude -y install php-intl 

                How To Uninstall php-intl on Ubuntu 20.04

                To uninstall only the php-intl package we can use the following command:

                sudo apt-get remove php-intl 

                Uninstall php-intl And Its Dependencies

                To uninstall php-intl and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

                sudo apt-get -y autoremove php-intl 

                Remove php-intl Configurations and Data

                To remove php-intl configuration and data from Ubuntu 20.04 we can use the following command:

                sudo apt-get -y purge php-intl 

                Remove php-intl configuration, data, and all of its dependencies

                We can use the following command to remove php-intl configurations, data and all of its dependencies, we can use the following command:

                sudo apt-get -y autoremove --purge php-intl 

                References

                Summary

                In this tutorial we learn how to install php-intl package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.

                Источник

                УСТАНОВКА INTL PHP

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

                Установка Intl в PHP может быть выполнена несколькими способами, но наиболее распространенный — это установка через менеджер пакетов. Например, при использовании Ubuntu следующая команда установит расширение:

                sudo apt-get install php-intl

                Если же вы управляете своим сервером и используете другой дистрибутив Linux, вы можете установить расширение Intl через приложение pecl:

                Если вы используете Windows, вы можете загрузить собранное расширение Intl с официального сайта PHP, затем добавить его в ваш PHP.ini файл:

                После установки расширения необходимо перезапустить веб-сервер, чтобы изменения вступили в силу. Вы можете проверить, что Intl теперь установлено, используя функцию phpinfo() .

                Важно также отметить, что для работы с Intl в PHP может потребоваться установка ICU библиотеки версии 4.0 или выше.

                PHP Stage 2. Проект 10. Выгрузка на хостинг

                Устанавливаем PHP на компьютер c ОС Windows

                How to install PHP 8.2.0 on Windows 10/11 [2023 Update] Run your first PHP Program — Complete guide

                PHP в 2023 — плюсы и минусы языка — Первый Бит

                Встроенный в PHP WEB сервер, установка и запуск

                PHP 2023. Установка PHP 8.x, ruphp.com и первый запуск программы. Окружение для разработки

                Источник

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