缺少Intl扩展名(下载FOSUSER Bundle)

时间:2014-10-18 11:19:37

标签: php macos symfony fosuserbundle intl

我试图下载FOSUSERBundle, 当我执行这个cmd时:

php composer.phar require friendsofsymfony/user-bundle '~2.0@dev'

它给了我这个错误:

 - symfony/icu v1.2.2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - symfony/icu v1.2.2 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
    - Installation request for symfony/icu == 1.2.2.0 -> satisfiable by symfony/icu[v1.2.2].

试图解决这个问题:

1 - 我通过取消注释这一行来编辑/etc/php.ini:extension=php_intl.dll 2-我下载了最后一个稳定版的php curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6 问题仍然存在,当我执行php -i时,第一行是:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_intl.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/php_intl.dll, 9): image not found in Unknown on line 0
phpinfo()

有什么办法可以解决这个问题吗?或没有这个FOSUSERBundle Syfony?

1 个答案:

答案 0 :(得分:0)

Intl Component docs中有一个很好的指南,说明为什么会出现此错误以及如何解决此问题。

您需要在系统上安装php_intl。查看适用于Mac OSX的this guide。确保之后安装了symfony/icu的正确版本:

  • 1.0。*:当intl扩展名不可用时
  • 1.1。*:当使用ICU 3.8或更高版本编译intl时
  • 1.2。*:当使用ICU 4.4或更高版本编译intl时

过去几年,这对许多symfony2用户来说都是一个问题。基本上,php_intl扩展的Symfony2实现将在不久的将来取代模块。查看this blog post for further details。由于此更改非常重要,因此它还将合并到Symfony2的 2.3 2.5 分支以及 master / 2.6 版本中。它还没有被标记,但很快就会出现。

修改:截至2014年10月24日,新版本已被标记,此问题应该永远消失!

相关问题