php 致命错误:找不到“IntlDateFormatter”类

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6242378/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 23:45:12  来源:igfitidea点击:

Fatal error: Class 'IntlDateFormatter' not found

phpinternationalizationwamp

提问by Jalal

I installed WAMP on my local machine. My PHP version is 5.3.3 in phpinfo()but that extension doesn't exist! :(

我在本地机器上安装了 WAMP。我的 PHP 版本是 5.3.3,phpinfo()但该扩展名不存在!:(

How can I install this extension without compiling it? Hereis just source of it.

如何在不编译的情况下安装此扩展?这里只是它的来源。

回答by Jalal

The extension was there! All you need to do is clearing the comment(;) before this line in php.inifile:

扩展在那里!您需要做的就是清除php.ini文件中这一行之前的注释(;) :

;extension=php_intl.dll

to

extension=php_intl.dll

回答by Bira

if you see this on Debian / other Linux platforms.

如果你在 Debian / 其他 Linux 平台上看到这个。

sudo apt-get install php5-intl- for PHP 5.6

sudo apt-get install php5-intl- 用于 PHP 5.6

sudo apt-get install php7.0-intl- PHP 7+

sudo apt-get install php7.0-intl- PHP 7+

Amazon Linux

亚马逊 Linux

sudo yum install php70-intl

sudo yum install php70-intl

After that restart Apache services.

之后重新启动Apache服务。

sudo service apache2 restartrestart apache to get the changes.

sudo service apache2 restart重新启动 apache 以获取更改。

回答by Archana

It may be because of Apache. Restart Apache by following command

这可能是因为 Apache。通过以下命令重新启动Apache

service httpd restart 

and try again.

然后再试一次。