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

时间:2014-01-08 21:18:01

标签: php symfony pear pecl icu

我遇到与this one相同的问题,但提供的解决方案对我不起作用。

我从the Symfony Downloads Page下载了带有供应商包的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版本?

2 个答案:

答案 0 :(得分:10)

根据您的具体情况,您应在composer.json文件中指定要使用“symfony / icu”:“1.1。*”

请参阅本页的“ICU和部署问题”部分:https://symfony.com/doc/2.4/components/intl.html

答案 1 :(得分:0)

您正在编辑错误的php.ini文件

在控制台中运行此命令:

  

php -i | grep php.ini

Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini

编辑该文件。 (这是php cli文件)