16

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:

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

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

Does someone know how to fix this issue?

Rob Allen
  • 12,643
  • 1
  • 40
  • 49
Max
  • 12,794
  • 30
  • 90
  • 142

1 Answers1

53

You need to have installed the intl PHP extension.

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.

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

Rob Allen
  • 12,643
  • 1
  • 40
  • 49
  • 4
    and a restart of `php` afterwards. – Max Jul 17 '12 at 08:52
  • But why does it even need the intl extension? Isn't it absurd for it to be dependent on an additional extension which only a minority of developers uses? – Swader Jul 20 '12 at 12:19
  • 1
    We're in Beta. One of the points of the beta is to find out what works and what doesn't. Clearly this hasn't worked quite as seamlessly as we'd have hoped! – Rob Allen Jul 20 '12 at 18:53
  • I'm not judging, I know bugs are to be expected, it just seems odd to leave an extension dependency hanging, even in beta, for so long. This is an easily fixable issue, and one that is far from minor. – Swader Jul 21 '12 at 21:26
  • This is still a common issue, which can be impossible to fix, depending on where the site is hosted. If your hosting provider doesn't support changing PHP configuration, and the application relies on i18n-dependent code, there is no other way to set it up. Some sort of built-in support would indeed be much better than relying on an extension which is rarely ever installed on hosting servers. – Vilinkameni Jul 10 '14 at 21:19