致命错误:在 ZF2 框架应用程序中找不到“区域设置"类 [英] Fatal error: Class 'Locale' not found with ZF2 skeleton application

查看:21
本文介绍了致命错误:在 ZF2 框架应用程序中找不到“区域设置"类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚按照给定的说明安装了 ZF2 beta5 应用程序:

I've just installed the ZF2 beta5 application as per given instructions:

$ git clone git://github.com/zendframework/ZendSkeletonApplication.git ./
Cloning into '.'...
remote: Counting objects: 1494, done.
remote: Compressing objects: 100% (660/660), done.
remote: Total 1494 (delta 681), reused 1373 (delta 581)
Receiving objects: 100% (1494/1494), 397.42 KiB | 357 KiB/s, done.
Resolving deltas: 100% (681/681), done.

$ php composer.phar install
Installing dependencies
  - Installing zendframework/zendframework (dev-master)
    Cloning d6b0afe61149c6d0669743aab5c73285c42cd0db

zendframework/zendframework suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
Writing lock file
Generating autoload files

当我访问应用程序时,出现以下错误:

When I access the application, I get the below error:

致命错误:找不到类区域设置"./vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php在线 220

Fatal error: Class 'Locale' not found in ./vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php on line 220

我没有尝试按照建议安装 Doctrine(因为我最终不想使用 Doctrine).

I haven't tried installing Doctrine as suggested (because I don't want to use Doctrine in the end).

有人知道如何解决这个问题吗?

推荐答案

您需要安装 intl PHP 扩展.

You need to have installed the intl PHP extension.

对于基于 APT 的系统,请尝试:sudo apt-get install php5-intl
对于基于 YUM 的系统,请尝试:sudo yum install php-intl
对于 OS X,从这篇文章开始,但请检查您拥有的 PHP 版本并下载正确的源.

For APT based systems, try: sudo apt-get install php5-intl
For YUM based systems, try: sudo yum install php-intl
For OS X, start with this article, but check the version of PHP you have and download the correct source.

之后您可能需要重新启动 PHP 或 Web 服务器.

You'll probably need to restart PHP or your web server afterwards.

这篇关于致命错误:在 ZF2 框架应用程序中找不到“区域设置"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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