[英]How to install PHP intl extension in Ubuntu 14.04
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
扩展?
For php5 on Ubuntu 14.04对于 Ubuntu 14.04 上的php5
sudo apt-get install php5-intl
For php7 on Ubuntu 16.04对于 Ubuntu 16.04 上的php7
sudo apt-get install php7.0-intl
For php7.2 on 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 NOTHING todo 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]
从终端安装它
sudo apt-get install php-intl
May be universe repository is disabled, here is your package in it可能是 Universe 存储库被禁用,这是你的包
Enable it启用它
sudo add-apt-repository universe
Update更新
sudo apt-get update
And install并安装
sudo apt-get install php5-intl
对于 ubuntu 16.04 上的 php 5.6
sudo apt-get install php5.6-intl
In Ubuntu 20.04, PHP 7.4 use the following command:在 Ubuntu 20.04、PHP 7.4 中使用以下命令:
sudo apt-get install php7.4-intl
replace 7.4 with your PHP version用你的 PHP 版本替换 7.4
此方法适用于我在Ubuntu 18.04和nginx 中安装 PHP intl 扩展
sudo apt install php7.2-intl -y
So, I have problem with it.所以,我有问题。 If you can't install see below.如果您无法安装,请参见下文。 And previously you have to add repository.以前您必须添加存储库。
sudo add-apt-repository ppa:ondrej/php
2.1) sudo apt-add-repository ppa:ondrej/apache2
2.1) sudo apt-add-repository ppa:ondrej/apache2
or或者
2.2) sudo add-apt-repository ppa:ondrej/nginx
2.2) sudo add-apt-repository ppa:ondrej/nginx
After that you can install之后你可以安装
sudo apt-get install php7.4-intl
Where 7.4 your php version.其中 7.4 你的 php 版本。
sudo apt-get install php-intl
然后重启你的服务器
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
进行aptitude search intl
,例如sudo aptitude install php-intl
最后sudo service apache2 restart
good Luck!祝你好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.