【问题标题】:Symfony - PHP-Intl ExtensionSymfony - PHP 国际扩展
【发布时间】:2014-08-22 11:33:31
【问题描述】:

我的问题如下:

我正在重新访问客户的网站。在它没有使用任何框架之前。现在我使用 Symfony2 作为后端。我的客户在 Strato.de 有他的网站空间,并且没有安装 Symfony2.3 或更高版本所需的 php-intl 扩展。

是否可以在没有此扩展的情况下安装 symfony - 如果可以,如何安装?

composer.json:

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.5.*",
    "symfony/icu": "1.0.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
    "sensio/generator-bundle": "~2.3"
},
"scripts": {
    "post-root-package-install": [
        "SymfonyStandard\\Composer::hookRootPackageInstall"
    ],
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.5-dev"
    }
}

}

composer.phar install 给出了这个错误:

Problem 1
- The requested package symfony/icu could not be found in any version, there may be a typo in the package name.
Problem 2
- symfony/symfony v2.5.3 requires symfony/icu ~1.0 -> no matching package found.
- symfony/symfony v2.5.3 requires symfony/icu ~1.0 -> no matching package found.
- Installation request for symfony/symfony v2.5.3 -> satisfiable by symfony/symfony[v2.5.3].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

【问题讨论】:

    标签: php symfony


    【解决方案1】:

    这应该可以帮助你:

    http://symfony.com/doc/current/components/intl.html

    "require: {
        "symfony/icu": "1.1.*"
    }
    

    将版本设置为

    "1.0.*" if the server does not have the intl extension installed;
    "1.1.*" if the server is compiled with ICU 4.2 or lower.
    

    编辑:

    根据您的要求块。

    Loading composer repositories with package information
    Updating dependencies (including require-dev)
      - Installing jdorn/sql-formatter (v1.2.17)
        Loading from cache
    
      - Installing psr/log (1.0.0)
        Loading from cache
    
      - Installing twig/twig (v1.16.0)
        Loading from cache
    
      - Installing doctrine/lexer (v1.0)
        Loading from cache
    
      - Installing doctrine/annotations (v1.2.0)
        Loading from cache
    
      - Installing doctrine/collections (v1.2)
        Loading from cache
    
      - Installing doctrine/cache (v1.3.0)
        Loading from cache
    
      - Installing doctrine/inflector (v1.0)
        Loading from cache
    
      - Installing doctrine/common (v2.4.2)
        Loading from cache
    
      - Removing symfony/finder (v2.5.3)
      - Installing symfony/symfony (v2.5.3)
        Loading from cache
    
      - Installing symfony/icu (v1.0.1)
        Downloading: 100%         
    
      - Installing doctrine/dbal (v2.4.2)
        Loading from cache
    
      - Installing doctrine/doctrine-bundle (v1.2.0)
        Loading from cache
    
      - Installing kriswallsmith/assetic (v1.1.2)
        Loading from cache
    
      - Installing symfony/assetic-bundle (v2.3.0)
        Loading from cache
    
      - Installing doctrine/orm (v2.4.4)
        Loading from cache
    
      - Installing twig/extensions (v1.1.0)
        Loading from cache
    
      - Installing swiftmailer/swiftmailer (v5.2.1)
        Loading from cache
    
      - Installing symfony/swiftmailer-bundle (v2.3.7)
        Loading from cache
    
      - Installing monolog/monolog (1.10.0)
        Loading from cache
    
      - Installing symfony/monolog-bundle (v2.6.1)
        Loading from cache
    
      - Installing sensiolabs/security-checker (v2.0.0)
        Loading from cache
    
      - Installing sensio/distribution-bundle (v3.0.4)
        Loading from cache
    
      - Installing sensio/framework-extra-bundle (v3.0.1)
        Loading from cache
    
      - Installing incenteev/composer-parameter-handler (v2.1.0)
        Loading from cache
    

    【讨论】:

    • 我尝试了你的提示并得到了错误:我更新了我的问题。谢谢!
    • 有什么想法或建议可以尝试吗?客户绝对不想更改提供者。
    • 我不确定。我对其进行了测试并获得了上述输出,因此它应该可以正常工作。你的 composer.json 的其余部分是什么样的?
    • 当您使用 composer install 时,它会恢复锁定文件中的内容,而 update 会重新读取 json。试试composer update symfony/icu
    猜你喜欢
    • 2021-09-01
    • 2018-03-26
    • 2015-03-04
    • 2015-07-26
    • 2017-08-18
    • 2017-12-01
    • 2018-07-18
    • 2018-03-21
    • 2014-06-20
    相关资源
    最近更新 更多