【问题标题】:Intl extension is missing ( downloading FOSUSER Bundle)缺少国际扩展名(正在下载 FOSUSER 捆绑包)
【发布时间】:2023-08-08 15:54:01
【问题描述】:

我正在尝试下载 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 ?

【问题讨论】:

    标签: php macos symfony fosuserbundle intl


    【解决方案1】:

    Intl Component docs 中有一个很好的指南,介绍了为什么会出现此错误以及如何解决它。

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

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

    在过去的几年里,这一直是许多 symfony2 用户的问题。基本上有一个 php_intl 扩展的 Symfony2 实现,它将在不久的将来取代该模块。查看this blog post for further details。因为变化非常大,它也将被合并到 Symfony2 的 2.32.5 分支以及 ma​​ster / 2.6 版本中。它尚未被标记,但应该很快就会提供。

    编辑:自 2014 年 10 月 24 日起,新版本已被标记,此问题应该永远消失!

    【讨论】: