Symfony 3 PHP警告:模块' intl'已经在第0行加载了Unknown

时间:2016-01-10 07:14:19

标签: php pecl icu intl symfony

我最近安装了symfony 3,虽然它似乎工作正常,但我注意到我的错误日志一直在填写以下消息。

[10-Jan-2016 01:03:11 America/Chicago] PHP Warning:  Module 'intl' already loaded in Unknown on line 0

在查看之后,我在composer.json文件中设置了这些文件以查看它是否有帮助。

"symfony/intl": "^3.0.1",
"symfony/polyfill-intl-icu": "^1.0"

但是在我对页面做任何事情之后仍然会看到错误,比如刷新它,或者尝试输入我的登录信息......

完整的composer.json位于下方,出于安全原因,我的域名被example.com取代。

{
    "name": "root/example.com",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "": "src/"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.0.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "symfony/intl": "^3.0.1",
        "symfony/polyfill-intl-icu": "^1.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^2.7"
    },
    "scripts": {
        "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::prepareDeploymentTarget"
        ],
        "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::prepareDeploymentTarget"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        }
    }
}

此外,我尝试按照类似于我的问题(Problems installing Symfony 2.4.1 lib-icu 4.4 dependency)的建议,但当我尝试设置" symfony / icu":" 1.1。*&# 34;作曲家拒绝这样做,因为我使用的是symfony 3 ...

我甚至不确定我的问题与他的问题是否相同。

我在Centos Linux服务器上使用WHM / Cpanel,以防我需要运行任何UNIX命令来解决此问题。

我相信我已经通过WHM控制面板安装了intl扩展,但我并非100%确定我也是这样做的。我已经在控制面板上附上了它的外观图像。

enter image description here

我也尝试过按照此处的说明(http://symfony.com/doc/current/components/intl.html

如何摆脱错误消息?

2 个答案:

答案 0 :(得分:2)

我认为这与Symfony无关。

通常情况是您使用--with-intl选项(内置intl)编译的已安装的PHP版本,并且您还安装了intl扩展名。

尝试禁用/卸载intl扩展程序并测试您是否仍可以使用symfony/intl功能而不会出现问题。

答案 1 :(得分:0)

v5.0.17之前的 SensioDistributionBundle在与Composer v1.3(more details)一起使用时会产生此类错误。

检查您是否可能受到影响:

composer --version && composer show | grep distribution-bundle

如果是这样,请通过将SensioDistributionBundle更新为最新版本来解决问题:

composer update sensio/distribution-bundle