How to install PHP intl extension in Ubuntu 14.04

2019-01-23 23:07发布

I have a hard time to find exact method to install PHP intl extension in Ubuntu 14.04.

I tried with sudo apt-get install php5-intl but displays error Unable to locate package.

I really need this extension for Zend Framework 2 , because of above missing extension I am getting error like this

ERROR: Zend\I18n\Validator component requires the intl PHP extension

I am using PHP 5.5.9.

How can I install PHP-intl extension in a correct way ?

5条回答
祖国的老花朵
2楼-- · 2019-01-23 23:26

install it from terminal

sudo apt-get install php-intl
查看更多
ゆ 、 Hurt°
3楼-- · 2019-01-23 23:30

May be universe repository is disabled, here is your package in it

Enable it

sudo add-apt-repository universe

Update

sudo apt-get update

And install

sudo apt-get install php5-intl
查看更多
劫难
4楼-- · 2019-01-23 23:32

For php 5.6 on ubuntu 16.04

sudo apt-get install php5.6-intl
查看更多
该账号已被封号
5楼-- · 2019-01-23 23:33

you could search with aptitude search intl after you can choose the right one, for example sudo aptitude install php-intl and finally sudo service apache2 restart

good Luck!

查看更多
欢心
6楼-- · 2019-01-23 23:51

For php5 on Ubuntu:

sudo apt-get install php5-intl

For php7 on Ubuntu

sudo apt-get install php7.0-intl

Anyway restart your apache after

sudo service apache2 restart

IMPORTANT NOTE: Keep in mind that your php in your terminal/command line has NOTHING todo with the php used by the apache webserver!

If the extension is already installed you should try to enable it. Either in the php.ini file or from command line.

Syntax:

php:

phpenmod [mod name]

apache:

a2enmod [mod name]
查看更多
登录 后发表回答