Problems installing Symfony 2.4.1 lib-icu 4.4 dependency

ⅰ亾dé卋堺 提交于 2019-12-05 00:28:12

问题


I'm having a problem identical to this one, but the solution provided there isn't working for me.

I downloaded the Symfony 2.4.1 Standard Vendors with Vendors package from the Symfony Downloads Page. After extracting the files and downloading composer.phar, I run php composer.phar install and get this error:

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].

Following the instructions on the thread linked to above, I updated PEAR libraries and did sudo pear install pecl/intl. (This is on CentOS so I didn't follow the MAMP stuff). This didn't work and I realized I had to do a sudo yum install libicu. After this, sudo pear install pecl/intl worked, and I edited php.ini to add the extension=intl.so line and then restarted the Apache server.

But I'm still getting the same error as above, and in addition, any time I run PHP it gives the warning:

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

Looking at the output of phpinfo() I see that the installed intl version is 1.1.0, and the ICU version is 4.2.1 (which explains why Symfony is complaining that it needs 4.4). But when I do /usr/bin/pecl install intl it says

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

And the sudo yum install libicu should have installed the latest version.

Is there any way to get the 4.4 version?


回答1:


For your specific situation, you should specify in your composer.json file that you want to use "symfony/icu": "1.1.*"

See the "ICU and Deployment Problems" section of this page: https://symfony.com/doc/2.4/components/intl.html




回答2:


you are editing the wrong php.ini file

run this command in console :

php -i | grep php.ini

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

edit that file. ( it's the php cli file )



来源:https://stackoverflow.com/questions/21006725/problems-installing-symfony-2-4-1-lib-icu-4-4-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!