如何在 Ubuntu 14.04 中安装 PHP intl 扩展
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42243461/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install PHP intl extension in Ubuntu 14.04
提问by Hiranya Sarma
I have a hard time to find exact method to install PHP intl extension in Ubuntu 14.04.
我很难找到在Ubuntu 14.04 中安装 PHP intl 扩展的确切方法。
I tried with sudo apt-get install php5-intl
but displays error Unable to locate package
.
我试过sudo apt-get install php5-intl
但显示错误Unable to locate package
。
I really need this extension for Zend Framework 2 , because of above missing extension I am getting error like this
我真的需要 Zend Framework 2 的这个扩展,因为上面缺少扩展,我收到这样的错误
ERROR:Zend\I18n\Validator component requires the intl PHP extension
错误:Zend\I18n\Validator component requires the intl PHP extension
I am using PHP 5.5.9.
我正在使用 PHP 5.5.9。
How can I install PHP-intl
extension in a correct way ?
如何PHP-intl
以正确的方式安装扩展?
回答by Spears
For php5on Ubuntu 14.04
对于Ubuntu 14.04 上的php5
sudo apt-get install php5-intl
For php7on Ubuntu 16.04
对于Ubuntu 16.04 上的php7
sudo apt-get install php7.0-intl
For php7.2on Ubuntu 18.04
对于Ubuntu 18.04 上的php7.2
sudo apt-get install php7.2-intl
Anyway restart your apache after
无论如何重新启动你的apache
sudo service apache2 restart
IMPORTANT NOTE: Keep in mind that your php in your terminal/command line has NOTHINGtodo with the php used by the apache webserver!
重要提示:请记住,终端/命令行中的 php 与 apache 网络服务器使用的 php没有任何关系!
If the extension is already installed you should try to enable it. Either in the php.ini file or from command line.
如果已经安装了扩展,您应该尝试启用它。在 php.ini 文件或命令行中。
Syntax:
句法:
php:
php:
phpenmod [mod name]
apache:
阿帕奇:
a2enmod [mod name]
回答by Abdallah Awwad Alkhwaldah
install it from terminal
从终端安装它
sudo apt-get install php-intl
回答by Alexey Shatrov
May be universe repository is disabled, here is your packagein it
可能是宇宙库被禁用,这里是你的包在里面
Enable it
启用它
sudo add-apt-repository universe
Update
更新
sudo apt-get update
And install
并安装
sudo apt-get install php5-intl
回答by kosala manojeewa
For php 5.6 on ubuntu 16.04
对于 ubuntu 16.04 上的 php 5.6
sudo apt-get install php5.6-intl
回答by Kasia Kasia
sudo apt-get install php-intl
then restart your server
然后重启你的服务器
回答by Valenkpo
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
aptitude search intl
例如sudo aptitude install php-intl
,您可以在选择正确的之后进行
搜索
,最后
sudo service apache2 restart
good Luck!
祝你好运!