Yum install 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 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.

                Источник

                How To Install php-intl on Rocky Linux 8

                In this tutorial we learn how to install php-intl on Rocky Linux 8.

                What is php-intl

                The php-intl package contains a dynamic shared object that will add support for using the ICU library to PHP.

                We can use yum or dnf to install php-intl on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install php-intl.

                Install php-intl on Rocky Linux 8 Using dnf

                Update yum database with dnf using the following command.

                sudo dnf makecache --refresh 

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

                sudo dnf -y install php-intl 

                Install php-intl on Rocky Linux 8 Using yum

                Update yum database with yum using the following command.

                sudo yum makecache --refresh 

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

                sudo yum -y install php-intl 

                How To Uninstall php-intl on Rocky Linux 8

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

                php-intl Package Contents on Rocky Linux 8

                /etc/php.d/20-intl.ini /usr/lib/.build-id /usr/lib/.build-id/fa /usr/lib/.build-id/fa/9ec9094997ffe2e13e5f0c719dfa686cc3e587 /usr/lib64/php/modules/intl.so 

                References

                Summary

                In this tutorial we learn how to install php-intl on Rocky Linux 8 using yum and dnf.

                Источник

                Original question:

                I’m having trouble installing the PHP Pecl Intl extension on my CentOs 5 machine. After installing both icu and libicu with the following commands:

                $ yum install icu $ yum install libicu 

                I selected to search for the default location for the ICU libraries and header files. It ends up crashing like this:

                checking whether to enable internationalization support. yes, shared checking for icu-config. no checking for location of ICU headers and libraries. not found configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works. ERROR: `/tmp/pear/temp/intl/configure --with-icu-dir=DEFAULT' failed 

                update

                After successfully installing the development version of icu as suggested by RusAlex (thanks RusAlex) like so:

                 /private/tmp/pear/temp/intl/collator/collator_class.c:92: error: duplicate 'static' /private/tmp/pear/temp/intl/collator/collator_class.c:96: error: duplicate 'static' /private/tmp/pear/temp/intl/collator/collator_class.c:101: error: duplicate 'static' /private/tmp/pear/temp/intl/collator/collator_class.c:107: error: duplicate 'static' make: *** [collator/collator_class.lo] Error 1 ERROR: `make' failed 

                It appears to have something to do with PHP 5.3 being bundled with Intl already. But how can I enable this extension, if I look in my PHP Info than I cannot find any reference to it.

                Источник

                Читайте также:  Live Data Search with Pagination in PHP using Ajax
Оцените статью