如何在Ubuntu 14.04中安装PHP intl扩展 [英] How to install PHP intl extension in Ubuntu 14.04

查看:135
本文介绍了如何在Ubuntu 14.04中安装PHP intl扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难在 Ubuntu 14.04 中找到安装PHP intl扩展的确切方法.

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

我尝试使用sudo apt-get install php5-intl,但显示错误Unable to locate package.

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

我真的需要Zend Framework 2的扩展,因为缺少上述扩展,我遇到了这样的错误

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

错误: Zend\I18n\Validator component requires the intl PHP extension

我正在使用PHP 5.5.9.

I am using PHP 5.5.9.

如何正确安装PHP-intl扩展程序?

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

推荐答案

对于Ubuntu 14.04上的 php5

For php5 on Ubuntu 14.04

sudo apt-get install php5-intl

对于Ubuntu 16.04上的 php7

For php7 on Ubuntu 16.04

sudo apt-get install php7.0-intl

对于Ubuntu 18.04上的 php7.2

For php7.2 on Ubuntu 18.04

sudo apt-get install php7.2-intl

无论如何都必须在重启后重新启动您的apache

sudo service apache2 restart

重要说明:请记住,您的php在您的终端/命令中 这行没有与apache网络服务器使用的php无关!

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.ini文件中,也可以从命令行中获取.

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

语法:

php:

phpenmod [mod name]

apache:

a2enmod [mod name]

这篇关于如何在Ubuntu 14.04中安装PHP intl扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆