安装Symfony 2.4.1 lib-icu 4.4依赖的问题

 1500799277_a9483d_353 发布于 2023-02-05 08:55

我遇到了与此相同的问题,但提供的解决方案对我不起作用.

我从Symfony下载页面下载了带有供应商软件包的Symfony 2.4.1标准供应商.解压缩文件并下载composer.phar后,我运行php composer.phar install并收到此错误:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/icu v1.2.0 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.
    - symfony/icu v1.2.0 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 v1.2.0 -> satisfiable by symfony/icu[v1.2.0].

按照上面链接的线程的说明,我更新了PEAR库并做了sudo pear install pecl/intl.(这是在CentOS上,所以我没有遵循MAMP的内容).这没用,我意识到我必须这样做sudo yum install libicu.在此之后,sudo pear install pecl/intl工作,我编辑php.ini添加该extension=intl.so行,然后重新启动Apache服务器.

但是我仍然得到与上面相同的错误,此外,每次运行PHP时它都会发出警告:

PHP Warning:  Module 'intl' already loaded in Unknown on line 0

看看输出phpinfo()我看到安装的intl版本是1.1.0,而ICU版本是4.2.1(这解释了为什么Symfony抱怨它需要4.4).但是,当我这样做/usr/bin/pecl install intl时说

pecl/intl is already installed and is the same as the released version 3.0.0

而且sudo yum install libicu应该已经安装了最新版本.

有没有办法获得4.4版本?

1 个回答
  • 对于您的特定情况,您应在composer.json文件中指定要使用"symfony/icu":"1.1.*"

    请参阅本页的"ICU和部署问题"部分:http://symfony.com/doc/current/components/intl.html

    2023-02-05 09:02 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有