我遇到了与此相同的问题,但提供的解决方案对我不起作用.
我从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版本?
对于您的特定情况,您应在composer.json文件中指定要使用"symfony/icu":"1.1.*"
请参阅本页的"ICU和部署问题"部分:http://symfony.com/doc/current/components/intl.html