How do I install PHP intl extension on CentOS?

109,252

Solution 1

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 2

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 3

I successfully installed INTL via pecl using following steps.

1) install icu & libs:

yum -y install icu libicu libicu-devel

2) php-devel package and phpize:

yum -y install php-devel phpize

3) and, of course gcc:

yum -y install gcc gcc-cpp gcc-c++

This is working for me.my php version is 5.6.12

Solution 4

for php 7.0 using

#list all options    
$ sudo yum list php7*intl

#install
$ sudo yum install php70-intl

Solution 5

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

https://superuser.com/questions/505340/centos-6-how-to-install-php-mysql-when-php-common-remi-is-present

2) Downgrade php-common to Version 5.3.3-14

yum downgrade php-common

I have no idea if you would run into more dependency issues and have to downgrade other packages. I found more details here.

https://www.centos.org/modules/newbb/viewtopic.php?topic_id=40567&forum=56

Other Stack Exchange sites show similar questions.

https://serverfault.com/search?q=centos+error+package (370 results)

https://unix.stackexchange.com/search?q=centos+error+package (57 results)

Share:
109,252
toxalot
Author by

toxalot

I'm a perfectionist, a self-taught, full-stack web developer, a mother of two beautiful girls, a pedantic copy editor, and an avid do-it-yourselfer. Once I left school, I discovered a love for learning.

Updated on May 07, 2020

Comments

  • toxalot
    toxalot about 4 years

    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.

    I did

    yum list php*intl
    

    and saw that there was one available. So I did

    yum install php-intl
    

    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?